Android Studio: Cannot execute aidl

When I built my Android application on Ubuntu Linux 16.04 in my amd64 machine with Andriod Studio, the Android Studio caused an error. The Andrdoid Studio said:

Error:Execution failed for task ':foobarbazquux:compileDebugAidl'.
> java.lang.RuntimeException: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/home/tom/Android/Sdk/build-tools/21.1.2/aidl''

Because the Sdk/build-tools/21.1.2/aidl is a 32bit application.

$ file aidl
aidl: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/, for GNU/Linux 2.6.15, not stripped

This executable needs 32bit libraries to work. I installed these with:

$ sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 lib32stdc++6

After this, the aidl got usable.

$ ./aidl
INPUT required
       aidl --preprocess OUTPUT INPUT...

   -I<DIR>    search path for import statements.
   -d<FILE>   generate dependency file.
   -a         generate dependency file next to the output file with the name based on the input file.
   -p<FILE>   file created by --preprocess to import.
   -o<FOLDER> base output folder for generated files.
   -b         fail when trying to compile a parcelable.

   An aidl interface file.

   The generated interface files.
   If omitted and the -o option is not used, the input filename is used, with the .aidl extension changed to a .java extension.
   If the -o option is used, the generated files will be placed in the base output folder, under their package folder

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s