20

I have installed android SDK and android eclipse plugin successfully on Ubuntu.

Every thing was working fine until I removed Ubuntu and installed Linux Mint. I installed the SDK again and used the same eclipse copy I was using on Ubuntu but now all the android applications contain errors and I can not start the emulator.

When starting the emulator this message appears

Starting emulator for AVD 'test' Failed to start emulator: Cannot run program "/home/anas/android//tools/emulator": error=2, No such file or directory

While the android SDK is installed in the specified path and the file (emulator) is exists in the same path.

Also all my applications contains the same error R can not be resolved to a variable

What is the problem here?

4

8 回答 8

29
  1. Installed on Ubuntu successfully. but not running avd

    If you're running a 64-bit system, you need to install ia32-libs

  sudo apt-get install ia32-libs
  1. R can not be resolved to a variable

This can be due to following Reason

  • class is not the part of that package add proper package

  • not properly defined in manifest file class path define it properly

clear and run the avd it will work

于 2013-01-29T08:47:11.897 回答
10

If cmd from fist comment doesn't work like in my case (64bit Crunchbang) then you may also try with :

sudo aptitude install ia32-libs lib32ncurses5 lib32stdc++6

于 2013-03-22T11:30:57.430 回答
7

I solved it doing a backup of the "emulator" and creating a symbolic link to the correct emulator:

mv emulator emulator_bup
ln -s emulator64-arm emulator
于 2014-03-08T09:59:43.650 回答
2

I used the command-line tool android (android avd), and used Tools->Manage SDK to install 64 bit emulators. I then mv'ed emulator to emulator.old, and emulator64-arm to emulator. Now the AVD starts up.

于 2013-11-14T18:49:12.730 回答
2

You do not need install packages any more!

In directory tools, there are many types of emulator, while my computer works with emulator64-arm! My system is Linux Mint 16 amd64! Good luck!

./emulator64-arm @yxphone -sdcard yxsd -scale 0.8
于 2013-12-13T08:32:47.827 回答
1

Like you have written the specified path and the files are exists in the same path, but i suggest to check that one more time.

and like you are getting R cannot be resolved to a variable, do not worry:

Reasons:

  1. Check Package name in Manifest File
  2. If you are already getting something like this: import com.version.bajrang.january.R; so first of all try to change package name here, or secondly just delete this line and clean your program
  3. If you are not getting something like: import com.version.bajrang.january.R; then add import packagename.R;

I believe that you will get your answer.....

于 2013-01-29T08:41:34.667 回答
1

It looks like your SDK path in eclipse has a mistake:

Cannot run program "/home/anas/android//tools/emulator"

That double "//" may be the problem. Check in Eclipse: Window -> Preferences -> Android. There should be a field there pointing the SDK Location. Edit it.

Check your path : /home/anas/android/ to see if it really is where you put your SDK . If not repeat these steps to have it

The missing R resource message is a compile error right? Then in this case your emulator should not be the problem. However, if your SDK path is incorrect like I suspect, then .. you can expect this compile error along with any other android libraries import

于 2013-01-29T08:42:27.193 回答
-2

This is sorted by running this on Ubuntu.

sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb

Refer this: Can't connect to emulator through ADB genymotion

于 2021-01-14T16:18:25.767 回答