Android Studio cannot start aapt on Kali Linux - android

I installed Kali Linux on my PC yesterday and installed Android Studio. But when I build a project Android Studio gives me these errors:
Error:org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/root/Android/Sdk/build-tools/19.1.0/aapt''
Error:Execution failed for task ':app:mergeDebugResources'.
Error: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/root/Android/Sdk/build-tools/19.1.0/aapt''
I searched little on the internet. There is a solution for that:
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
When I run these commands in the terminal, it says:
Lîsteya pakêtan tê xwendin... Çêbû //reading package lists... Done
Building dependency tree
Reading state information... Çêbû
E: Pakêt nehate dîtin lib32stdc++6 //package is not found... Done
E: Couldn't find any package by regex 'lib32stdc++6'
What can I do?

The Problem is arising due to the misconfiguration of android adb and android development tools.
You Need to install some extra packages from the market place.
Android SDK Build-tools
(1)Location: $ANDROID_HOME/build-tools/$VERSION/
(2)Documentation
3.)Main tools: aapt (to generate R.java and unaligned, unsigned APKs), dx (to convert Java bytecode to Dalvik bytecode), and zipalign (to optimize your APKs).

Related

Gradle Build Exception : AAPT process not ready to receive commands

This might be duplicate question but after trying all solution I'm not able to solve following error:
Error:Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: AAPT process not ready to receive commands
I tried all except one solution:
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
what exactly commands will be before executing this commands?? and if anyone have other solution than this please tell me, It will be very useful..
linux 64ver, install
lib32stdc++6(or lib32stdc++5)
lib32z1(maybe its name is lib32zlib)
you can search them here ,to confirm their real names in you linux distro repo. https://pkgs.org/
Go to Project structure by clicking (ctrl+shift+alt+s), in that go to Project tab change Gradle Version to 3.2 and Project Version to 2.2 .
This works fine for me.
The answer is simple .
inside the gradle module app change the build tool version to 23.0.3 , gradle version to 2.2.2

Unable to run aapt which has been installed through the Android SDK, what could be the reason?

I'm trying to run a Gradle build within a Docker Ubuntu machine.
The application i'm compiling is supposed to generate an .apk file and so I'm using the aapt packager which comes as part of the Android SDK build-tools which I've installed using the following command:
android update sdk -u -a -t 7 (Android SDK Build-tools, revision 23.0.3)
But then, when I run Gradle it fails with the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Company-ServicesSDK:processReleaseResources'.
> A problem occurred starting process 'command '/Users/itai/repos/Company-Android_fork/.gradle/android-sdk-linux/build-tools/23.0.3/aapt''
Through my Macbook I'm able to run the aapt and it works properly but from within the Docker machine, when I try to run it, I get:
bash: ./aapt: No such file or directory
Running file aapt from my Mac:
aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, not stripped
Anyone knows why it happens and how to solve it?
If it interest anyone, I found that in order to fix this issue I had to install the following packages:
lib32z1
gcc-multilib
make
After installing these packages, running aapt gave me the proper output.

Android Studio 2.0 - Error:Execution failed for task app:compileDebugAidl

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.

aapt finished with non-zero exit value 127

For 2 days, I have been trying to get a blank android activity to compile on intellij idea ultimate on Ubuntu 14.04 64-bit. This error has really stumped me:
Error:Gradle: Execution failed for task ':app:mergeDebugResources'.
> /home/guarddog/Documents/github/IcsTrac/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/drawable-ldrtl-hdpi/abc_ic_ab_back_mtrl_am_alpha.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/android-sdk-linux/build-tools/22.0.1/aapt'' finished with non-zero exit value 127
Note I have Java 8, Gradle 2.5 and /usr/local/android-sdk-linux/tools all in my $PATH.
I tried the advice here: Gradle build failed in Android Studio. But the error still occurs. How can I resolve this issue?
I meet the similar issue. I install lib32z1 and problem solved. Hope it could help.
Thanks #agustin.aliaga's answer in:
finished with non zero exit value
In my case, I had to install libz.so.1 library to make it work, on Ubuntu 15.04 with this command:
sudo apt-get install lib32z1
Later, I make a deep survey and found to support 32bit Android platform in ubuntu 64 os, one should install the 32bit library.
sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
I usually just do Build> Rebuild Project or Clean Project
if that doesn't work then I go File> Invalidate/Caches Restart and choose Invalidate and Restart
Close Android Studio, delete build folders from your project location, than open AS and choose rebuild option.
Hope it help. Let me know if you still have that problem.
EDIT: Please, check also this issue:
finished with non zero exit value

Android studio 1.0.2 not building app:mergeDebugResources error

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)

Categories

Resources