Error:Execution failed for task ':app:compileDebugAidl ProcessException

5.7k views Asked by At

I am not able to build Aidl Library.
Error:


Error:Execution failed for task ':app:compileDebugAidl'. java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing
'D:\mysdk\Android\android-sdk\build-tools\22.0.1\aidl.exe' with arguments
{-pD:\mysdk\Android\android-sdk\platforms\android-21\framework.aidl -...
dC:\Users\admin\AppData\Local\Temp\aidl6013369886374174489.d ...\dev\myaidllibrary\ICoffeeMakerRemoteService.aidl}

build.gradle:

apply plugin: 'com.android.library'
apply plugin: 'com.neenbedankt.android-apt'
android {
    compileSdkVersion 21
    buildToolsVersion '22.0.1'
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:21.0.0'
    testCompile 'junit:junit:4.12'
    provided 'com.google.auto.value:auto-value:1.2-rc1'
    // needed for Android Studio
    apt 'com.google.auto.value:auto-value:1.2-rc1'
    apt 'com.ryanharter.auto.value:auto-value-parcel:0.2.0'
}

Directory Structure:

aidl->
ICoffeeMakerRemoteService.aidl
Ingredient.aidl
java->
Ingredient.java

I'm stuck with these, tried possible solutions.

7

There are 7 answers

0
sivaBE35 On

change build tool to

buildToolsVersion "21.0.1"
0
Amol K On

I faced the same kind of error. The reason was the .aidl file I was copying to client application which access the service was not under the proper package. Just try to create the package and make sure you copy the aidl file under proper package name of the app.

0
Yeung On

For me, this happen when I define overload methods with different signatures in aidl. Seem like overload methods is not supported.

Not allowed:

public void methodA(int a);
public void methodA(int a, String b);

Allowed:

public void methodA(int a);
public void methodB(int a, String b);

Found more is not allowed, cannot define String array in the signature Not Allowed:

public void methodA(String[] a);
0
KongJing On

I rename the aidl's package on Left navigation bar , and Consistent with the code in ***.aidl。

0
user1737666 On

Try to build with --debug option and looking for "can be an out type, so you must declare it as in, out or inout."

0
kevinems On

I got the same mistake, but I fixed it. I guess you want to "Passing Objects over IPC", so do I.

My problem is that I missed the package define in the object aidl such as Rect.aidl, so please try to add package into your aidl file.

for example:

Rect.aidl

package android.graphics;  // important

// Declare Rect so AIDL can find it and knows that it implements
// the parcelable protocol.
parcelable Rect;
0
Bill On

https://github.com/frankiesardo/icepick/issues/46

1.Delete android/app/build Folder
2.build -> clean
3.build -> rebuild
try again.