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?
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
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
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
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
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.
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
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:
Check Package name in Manifest File
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
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.....
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
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
Related
I tried to launch application in emulator in android Studio in ubuntu 14.04 and it shows the following errors.
Error shown while gradle build is in process:
/home/next/NTE/MachineSetup/android-sdk-linux/tools/emulator -netdelay
none -netspeed full -avd Nexus_5X_API_24
Could not launch
'/home/next/NTE/MachineSetup/android-sdk-linux/tools/qemu/linux-x86/qemu-system-x86_64':
No such file or directory
Error appear after gradle build completed:
12/02 16:47:57: Launching app Error while waiting for device: The
emulator process for AVD Nexus_5X_API_24 was killed.
I have attached screenshots for your reference.
The first error's reason is below:
There are two emulators: one in $SDK/tools, another one in $SDK/emulator.
The one in $SDK/tools cannot start.
Please place $SDK/emulator before $SDK/tools in your $PATH variable, it should fix the problem.
I'm using Android Studio 2.3: edit file : .profile
export ANDROID_HOME=${HOME}/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/emulator
before
export PATH=${PATH}:${ANDROID_HOME}/tools
Like:
Not sure if this will help for you but I was seeing this error trying to run emulator in the console. I changes the ANDROID_SDK to point to the bin folder in my .bash_profile and that corrected the issue
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK=$ANDROID_HOME/lib
I try with this code in .bashrc now it's working:
export ANDROID_HOME=/home/AccountName/Android/Sdk
export PATH=${PATH}:${ANDROID_HOME}/emulator
1: add $SDK/emulator in your $PATH variable
2: remove $SDK/tools in your $PATH variable
3: adb kill-server
4: adb start-server
5: Start the emulator from the command line
Example:
emulator #Pixel_XL_API_23
It may be Android Emulator is not installed.
To add it to the Android Studio installation, go to Tools->Android->SDK Manager, select the SDK Tools tab, then ensure that Android Emulator is selected.
So I looked around to find some similair posts that encountered what you did, for the 1st error I found this that might fix the issue:
qemu-system
for the second one:
I saw multiple people that had this issue (source not super relevant). Some recommended updating your android studio or the SDK. Seeing as this might intervene with the 1st error I recommend just doing the 1st step and then check again.
Also, this happened for me when I had the system image installed — but not the emulator itself.
I faced same issue today. These are steps i did and now working fine. I am using arch-linux os.
process will be same on .bashrc too.
export PATH=${ANDROID_HOME}/emulator:${PATH}
export PATH=${ANDROID_HOME}/tools/bin:${PATH}
export PATH=${ANDROID_HOME}/platform-tools:${PATH}
I faced error due to exporting path to tools directory instead of bin directory in tools.
export PATH=${ANDROID_HOME}/tools:${PATH}
This solution is for android-sdk.
Try copy 'lib' folder from your Android sdk location /Android/Sdk/tools/lib64/qt/lib to ../Android/Sdk/tools/lib/qt/lib
I am new to the Linux. I am using centos 7 and trying to install the emulator. I have installed android-sdk. while I try to create SD Card in the emulator I get error stating that : error while loading shared libraries: libgcc-s.so.1: cannot open shared object file. No such file or directory exist.
You can refer following links.
want to create folder in sdcard on AVD
https://askubuntu.com/questions/409905/apt-get-error-loading-libgcc-s-so-1
https://confluence.atlassian.com/display/STASHKB/libgcc_s.so.1%3A+cannot+open+shared+object+file%3A+No+such+file+or+directory
There isn't very much documentation for using the emulator with Centos.
I ran into a similar problem and found the issue was that I didn't set the LD_LIBRARY_PATH environment variable.
Try executing this line before you start the emulator:
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib
Simply adding this line wasn't enough, I had to install the package because I didn't have it.
If you run into this issue, try:
yum provides \*/libgcc_s.so.1
Check to see which package you need (32-bit or 64-bit) and install it using this command:
sudo yum install <package-name>
If the package is already installed, I suggest uninstalling all packages that refer to the file and reinstalling only the one you need:
sudo yum remove <package-name>
Hopefully this is useful to someone... good luck!!
I have installed the Android SDK but I can't get the Adroid SDK manager to open.
I have looked everywhere on the internet and this is what I have already done which didn't help:
1. run sdk as administrator
2. adding a path pointing to the JDK in all of these forms :
C:\Program Files\Java\jdk1.7.0_21\bin;%SystemRoot%\system32;
C:\Program Files\Java\jdk1.7.0_21\bin;
C:\Program Files\Java\jdk1.7.0_21\
C:\Program Files\Java\jdk1.7.0_21
C:/Program Files/Java/jdk1.7.0_21/bin;
none of them worked ..:-(
3.
Step #1: Open up a command prompt.
Step #2: Use the cd command to move to wherever you installed your Android SDK.
Step #3: Run tools\android.
after doing it I got an error message that said that :
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java installed on your system.
4. deleting 3 times the sdk and reinstalling it.
5. Deleting the .android folder from the user (C:/Users/[User Name]) directory
By the way I have Windows 7 , and I have downloaded the 64 -bits sdk.
I am so helpless.. I ll appreciate a lot a solution...
Shiran
I had the same problem. Try to add an environment variable :
JAVA_HOME : "C:\Java\jdk1.7.0_25\".
It solves problem for me.
WRT Ubuntu 14.04:
You may not have java installed globally in your machine. My fix was to do:
sudo apt-get install openjdk-7-jdk
After was I able to run the SDK Manager.
When launching DDMS from the command line in Lion (10.7.3) I get the following error:
E/adb: Failed to get the adb version: Cannot run program "/Users/stevieo/android-sdk-macosx/tools/adb": error=2, No such file or directory
This makes sense to me because adb is actually in: /Users/stevieo/android-sdks/platform-tools
How can I modify this path so that ddms will launch on my system?
I have looked into the ddms file itself, but cannot decipher its intent.
One note, I do NOT have this issue on Snow Leopard (10.6.8)....
TIA for any thoughts or assistance.
Regards,
Steve O'Sullivan
If you look into your tools directory where you launched ddms, you will see the adb_has_moved.txt which says:
The adb tool has moved to platform-tools/
If you don't see this directory in your SDK,
launch the SDK and AVD Manager (execute the android tool)
and install "Android SDK Platform-tools"
Please also update your PATH environment variable to
include the platform-tools/ directory, so you can
execute adb from any location.
To solve this, I would change your ~/.bash_profile to have a line like:
# --- add Android platform-tools directory
PATH=~/android-sdks/platform-tools:$PATH
export PATH
Make sure to open up a new Terminal window so it will reload ~/.bash_profile
Note that a possible reason why it is working on your 10.6.8 installation is that you may have an older version of the Android SDK, where adb was in still in the tools directory.
If you are trying from eclipse,
Please make sure to create a adb link in /usr/bin/ directory which should solve the problem:
Ex: ln -s /Users//android-sdks/platform-tools/adb /usr/bin/adb
Note: logging as sudo/root may be required
I'm using Ubuntu 11.10 and Eclipse for android developing. I've already made a new project, but it contains error:
Failed to parse the output of 'adb version'
I will be thankful if anyone have an idea how can I fix that?
Install Oracle JRE using PPA:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
Install ia32-libs from software center.
Two options to solve this problem on windows:
Option 1:
Close the eclipse, if it is running.
Run the command prompt.
Go to the tools location of the android sdk.
run 'adb kill-server'
then run 'adb start-server'.
start the eclipse.
Option 2:
Open the task manager.
kill the adb process.
start the eclipse.
Problem should be solved.
The official Android SDK only runs on i386 JVM, so you need to manually specify the i386 JVM on Eclipse.
First install the Sun(Oracle) 32-bit JVM. Here is a step-by-step on how to do this:
Add the JVM to Eclipse. Navigate:
Window > Preferences > Java > Installed JREs > Add
Put the location of the JVM. Probably will be /usr/lib/jvm/java7/ (my is /usr/lib/jvm/java-7-sun-1.7.0.01). The external libraries will be automatically added when you put the location of the JVM.
Set the Sun (Oracle) 32-bit JVM as default.
if you run eclipse immediately after installing your java JDK, the java virtual machine MIGHT not be properly started. you will receive this error code when launching eclipse.
first check if when you installed your JDK, you copied a script file
/etc/init.d/jexec
if you did, before you do anything fancy, reboot your machine so that jvm starts properly. if you didnt, please decompress your jdk rpm file and extract the contents properly and then reboot.
worked for me, i just had this problem while installing adt bundle (and java jdk) on a virgin install of ubuntu 12.04 on a 64bit machine.
Delete the platform tools and then re-install them from the SDK manager
Copy the sdk\platform-tools contents to sdk\tool
also you must have a JAVA_HOME env var pointing to your java location
ex. JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21