I just installed android studio on linux , configured the SDK and installed the building tools now when I try to sync with gradle or (build the app) it fails and throws this error :
Error:Execution failed for task ':app:mergeDebugResources'.
/home/user_name/AndroidStudioProjects/project_name/app/src/main/res/drawable-hdpi/ic_launcher.png: Error: Cannot run program "/home/user_name/Android/Sdk/build-tools/21.1.2/aapt": error=2, No such file or directory
Error:Error: Cannot run program "/home/user_name/Android/Sdk/build-tools/21.1.2/aapt": error=2, No such file or directory
/home/user_name/AndroidStudioProjects/project_name/app/src/main/res/drawable-hdpi/ic_launcher.png
I tried to change the ' buildToolsVersion ' in my gradle file and it gave me the same error for 21.1.2 , 1 , 0 also.
I solved the problem by running those commands
$ sudo apt-get install lib32stdc++6
$ sudo apt-get install lib32z1
Ubuntu can't run the aapt on 64 bit before installing this packages
EDIT 19-04-2016 :
Android Studio 2 have the installation guide updated with those packages and bunch more to compile on 64-bit machines correctly
$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
I had the same issue even after trying out the accepted solution. In my case the gradle build tool version that I've specified was not installed on my debian system. It worked like a charm after I changed the buildToolVersion to the installed version which was (23.0.2)
Related
I am trying to run an android project in android studio. During gradle sync, I am getting the following error:
Even when I try to execute the file from terminal, I get the same error:
Mycomputer:~/Android/Sdk/build-tools/28.0.0-rc1$ ./arm-linux-androideabi-ld
bash: ./arm-linux-androideabi-ld: No such file or directory
I have tried the following:
try with build-tools version 25.0.3
giving all permissions for the
file arm-linux-androideabi-ld (chmod 777)
Still I don't have any success.
It seems you missing the 32-bit libraries. Which cause the exception No such file or directory when executing them.
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
Additionally, you can check if the file is 32-bit to make sure this is the cause reason:
file arm-linux-androideabi-ld
Output:
arm-linux-androideabi-ld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.8, stripped
after upgrading my Android Studio 1.5 to 2.0 and my Android SDK Tools to 25.1.1 and Android SDK Build-tools 23.0.3 and gradle plugin to version 2.0.0 i get this error :
Error:Execution failed for task ':app:compileDebugAidl'.
> java.lang.RuntimeException: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/home/rasool/android/adt.../sdk/build-tools/23.0.3/aidl''
the problem was that iam running a 64-bit version of linux and changed my OS recently and i forgot to install necessary 32-bit libraries.
in Ubuntu :
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
in Fedora :
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
if you get this error in Ubuntu :
E: Unable to locate package lib32bz2-1.0
E: Couldn't find any package by glob 'lib32bz2-1.0'
E: Couldn't find any package by regex 'lib32bz2-1.0'
you can skip this library and use this command :
sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
Try Build -> Clean Project
Sometimes Gradle builds will fail due to duplicate build files in the project.
i have recently installed android studio on my newly installed OS ubuntu 14.10, i installed the main android studio file in my documents folder, and then downloaded and installed the sdk build tools file in the documents folder aswell and linked the two via the sdk in android studio, i also downloaded all the latest apis and build tools, however when i build my first app
Error:Error: Cannot run program "/home/user/Documents/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
and
Error:Execution failed for task ':app:mergeDebugResources'.
/home/user/AndroidStudioProjects/Epic3/app/src/main/res/drawable-mdpi/ic_launcher.png: Error: Cannot run program "/home/user/Documents/android-sdk-linux/build-tools/21.1.1/aapt": error=2, No such file or directory
Any ideas?
Thanks
I faced the same problem and in my case is that im running Ubuntu 64 version. I solved that running the following command line:
apt-get install -qq -y libc6:i386 libgcc1:i386 libstdc++6:i386 libz1:i386
I was creating a new project out of nothing, for testing purpose, leaving all parameter to default (I didn't made any code change), on a new ADT installation (Ubuntu Gnome 14.04 LTS, x86_64 CPU), but I have the following error in the Eclipse Console :
[2014-06-11 09:03:10 - Kronos] /home/erwan/Applications/ADT/adt-bundle-linux-x86_64-20140321/sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Here is what I already tried:
-> I tried to (re)install ia32-libs, libstdc++ and libstdc++6 via Ubuntu software repository : No change
-> Checked for update (for Eclipse and the SDK) : No change
-> Reinstalled All Android Build tools : No change
-> Reinstalling ADB : No change
sudo apt-get install lib32stdc++6 lib32z1
On my 64-bit Ubuntu 14.04 desktop, this was all I needed:
sudo apt-get install lib32stdc++6
I too have a 64-bit Ubuntu 14.04 desktop, and the correct answer for that setup is indeed:
sudo apt-get install lib32stdc++6
In my Ubuntu 16.04 , I am not able to install "All" the libs ( sudo apt-get install lib32stdc++6 ) with message saying:
$ sudo apt-get install libgl1-mesa-dev:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libgl1-mesa-dev:i386 : Depends: libgl1-mesa-glx:i386 (= 11.2.0-1ubuntu2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
After some digging, I found I was using the aapt with SDK 19. (
android-sdk-linux/build-tools/19.x.y/aapt )
switch the appt from sdk 19 to sdk 24 worked for me.
by editing the corresponding gradle file, change the buildToolsVersion from 19 to 24.0.1:
android {
buildToolsVersion "24.0.1"
}
i'm using ubuntu 15.04 version.I had the same problem.
I had already installed ia32-libs package(which has now changed to lib32z1 lib32ncurses5 package)
when i tried using command
sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev
i got a list of lib32stdc++6 packages which might solve the problem but this command wasn't able to correct the problem.
so i just installed lib32stdc++6 package by using command
sudo apt-get install lib32stdc++6
this worked perfectly for me
So I get the following error when creating a new project on Android Studio 0.5.2 on Ubuntu 13.04 64-bit and trying to run it on a physical device:
Information:/home/juan/Documents/android-studio/sdk/build-tools/android-4.4.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: Failed to run command:
/home/juan/Documents/android-studio/sdk/build-tools/android-4.4.2/aapt s -i
/home/juan/AndroidStudioProjects/MyApplication4/app/build/exploded-aar/com.android.support/appcompat-v7/19.0.1/res/drawable-hdpi/abc_list_selector_disabled_holo_light.9.png -o /home/juan/AndroidStudioProjects/MyApplication4/app/build/res/all/debug/drawable-hdpi/abc_list_selector_disabled_holo_light.9.png
Error Code:
127
Output:
/home/juan/Documents/android-studio/sdk/build-tools/android-4.4.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
I've got the same setup (AS 0.5.2) on a MacBook Pro and Gradle completes successfully with no errors at all, so something must be wrong. I also had to install 32-bit versions of a couple libraries to get adb working on my 64-bit Ubuntu. Maybe that's whats going on here? Any help would be appreciated.
EDIT Also tried installing the following libraries:
$sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
No luck.
fixed it by reinstalling
sudo apt-get install lib32z1 lib32z1-dev
Thanks anyway!
I have a 64 bit Ubuntu, and I resolved the problem by installing
the following packages
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
http://developer.android.com/sdk/installing/index.html