everybody, I am the android developer, I am using ubuntu 14.04 LTS.
Because of some hardware problem, I have to format my PC. before that android studio , SDK and Java were working perfectly.
After formatting my PC. I installed jdk1.8.0_71. after i extract android studio deb file with command sudo dpkg -i android-studio_4.13.0-ubuntu0_all.deb
and 'android-studio' folder extracted at /opt directory.
after that, i try to run /opt/android-studio/bin/studio.sh with command.
sh ./studio.sh and it gives me error like this
I have also tried by ./studio.sh to execute but same error. please help to solve.
To install Oracle Java on Ubuntu, do this:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
I do this every time I install an Android Studio and it works flawlessly. And your Java 8 will be kept up to date, too. The environment variables are automatically properly set by that procedure.
its all about ELF execution (when you get bushes in output)
when your 64 bit os tries to start the Android SDK which in turns tries to run some 32 bit binaries and thus is the issue of compatibility.
check you have proper libs installed for studio
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
64-bit architecture your you need
sudo apt-get install libncurses5:amd64 libstdc++6:amd64 zlib1g:amd64
and 32 bit:
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
for details see:
https://developer.android.com/studio/install.html
ps if apt could not find such libs try to search for similar - the name can vary for different distro
also use proper java hotspot (jdk) 32/64bit for your system
Setting up Android Studio takes just a few clicks.
While the Android Studio download completes, verify which version of the JDK you have: open a command line and type javac -version. If the JDK is not available or the version is lower than 1.8, download the Java SE Development Kit 8.
To install Android Studio on Linux, proceed as follows:
Unpack the .zip file you downloaded to an appropriate location for your applications, such as within /usr/local/ for your user profile, or /opt/ for shared users.
To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and execute studio.sh.
Tip: Add android-studio/bin/ to your PATH environment variable so you can start Android Studio from any directory.
Select whether you want to import previous Android Studio settings or not, then click OK.
The Android Studio Setup Wizard guides you though the rest of the setup, which includes downloading Android SDK components that are required for development.
Note: If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
For your details:
https://storage.googleapis.com/androiddevelopers/videos/studio-install-linux.mp4
I had similar problems with finding java by starting android-studio on ubuntu.
I solved the problems by editing the studio.sh file.
In the file the JAVA_HOME variable should be set, but it wasn't.
So I set the JAVA_HOME variable in the script manually and I could start android-studio.
Finally i solved my problem bu reinstalling java properly. i thought i installed wrong java/jdk. now Android Studio,Java is working.
I found this link useful to install java step by step. Link to install java step by step
Install Android Studio in ubuntu :
At first install JDK
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
Download the android studio from here
https://developer.android.com/studio
Unzip android studio tar file using :
sudo unzip android-studio-ide-141.2178183-linux.zip -d /opt
or Simply unzip the download file using Archive Manager
Goto to android-studio/bin folder and open terminal or in terminal type
/opt/android-studio/bin
Then type :
./studio.sh
Android studio lunch your computer.
It takes about 30 min to one hour to finish gradle.
There recommend some updates and you should provide those updates.
For installing app using your phone, open developer mode. If you cannot see developer options go to about phone and tap build version 8 times.
In developer options turn on usb debugging.
Connect the phone into the computer using a USB cable.
Give a commands : sudo apt install adb
On the phone there is a dialog for debugging permission. Provide the permission.
Then install the app.
For saw the program in desktop goto tools->Create Desktop Entry-> Ok
Please, try to install java 7 or openjdk. It must solve problem.
Settings for Android Emulator when it fails
[android] Using Android SDK: /opt/android-sdk-linux
[android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_en-US_120_WVGA_Google_Inc._Google_APIs_23_google_apis-armeabi-v7a.avd
[android] /opt/android-sdk-linux/tools/android create avd -f -a -s WVGA800 -n hudson_en-US_120_WVGA_Google_Inc._Google_APIs_23_google_apis-armeabi-v7a -t "Google Inc.:Google APIs:23" --abi google_apis/armeabi-v7a
[android] Could not create Android emulator: Failed to parse AVD config file
But as soon as I am entering Android OS Version to: 6.0 . It will succeed to create new emulator and it runs.
My requirement is that is need Google Maps support for emulator.
Install required libraries for 64-bit machines:
If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
source : https://developer.android.com/studio/install.html
I'm having the same issue, and it was a matter of permissions. I installed all the android sdk dependencies from a ssh console with user "console_user", and then Jenkins was triying to run the tools with user "jenkins". The solution comes in various steps:
Add user "jenkins" to group "console_user".
Add group write permissions to the android sdk home dir and all the subdirectories:
chmod g+w $ANDROID_HOME -R.
Hope this helps or at least give you an advice.
I am running my Android studio on Ubuntu 14.04,its was working fine but suddenly its shows the following error while do build my project.
Error message:
ADB not responding. If you'd like to retry, then please manually kill "adb" and click 'Restart'
I have tried the following in terminal but it also not worked
node#node-Lenovo-G550:~/Android/Sdk/platform-tools$ adb kill-server
The program 'adb' is currently not installed. You can install it by typing:
sudo apt-get install android-tools-adb
but I have adb under platform-tools folder, I do not know why its says "not installed", How I can resolve this?. Please help me.
terminal image
Updated question:
I have added path as following:
export PATH=$PATH:/home/node/Android/Sdk/platform-tools
then executed this: ./adb kill-server
it gives me the following error
bash: ./adb: No such file or directory
if I run as adb kill-server it gives bash: /home/node/Android/Sdk/platform-tools/adb: cannot execute binary file: Exec format error
The directory where add is located, is not in your PATH variable. You could add it to your PATH variable (export PATH=$PATH:~/Android/Sdk/platform-tools I believe). You can also use ./adb kill-server. Note the ./ in front of adb. Because you are executing an executable in your current directory, you need ./
I have done the following steps and its works.
first run following comments to install:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
Second step is move the ADB and Fast boot to our SDK location.
cp /usr/bin/adb <path-to-your-adt-sdk-package>/sdk/platform-tools/adb
cp /usr/bin/fastboot <path-to-your-adt-sdk-package>/sdk/platformtools/fastboot
Last run the command:
SDK location/platform-tools/ adb kill-server.
I installed android studio on Ubuntu and tried running an application.
Seems as there are problem with permission, check if you have permission to execute '.../platform-tools/adb'
Install adb using the following comands
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
I tried everything i found on other forum with no luck.
I tried running it to root and non-root.
I tried setting up the environment vars.
I tried purging android studio and reinstall.
I can see my avd ini and related files for the avd in /root/.android/avd
I did change the permission of the files with no result.
I looked everywhere and out of options.
I was having the same problem here. I fixed this by creating a link in my $HOME directory to the /root/.android/avd
$ echo $HOME
/home/myuser
$ ln -s /root/.android/avd /home/myuser/.android/avd
Try this sudo apt-get install lib32z1 lib32z1-dev lib32stdc++6