2017-01-04 2 views
4

Aidl 라이브러리를 빌드 할 수 없습니다.
오류 :오류 : 작업 ': app : compileDebugAidl에 대한 실행이 실패했습니다.


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' 
} 

디렉토리 구조 :

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

내가이와 붙어있어, 시도 가능한 솔루션을 제공합니다.

buildToolsVersion "21.0.1" 
+0

코드와 일치 에AIDL의패키지의 이름을 변경 . 그것은 작동하지 않습니다. Thnsks – AskQ

+0

https://github.com/rharter/auto-value-parcel/pull/92를 참조하십시오. – AskQ

답변

0

변경 빌드 도구는 내가 같은 실수를 가지고,하지만 난 그것을 고정. "IPC를 통한 객체 전달"을 원합니다.

내 문제는 Ingredient.aidl과 같은 객체 aidl에서 패키지 정의를 놓친 것이므로 aidl 파일에 패키지를 추가하십시오. . 예를 들어

: 나를 위해

Rect.aidl

package android.graphics; // important 

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

, 내가 AIDL 다른 서명 과부하 방법을 정의 할 때 이런 일이. 오버로드 메소드가 지원되지 않는 것 같습니다.

은 허용되지 않음 :

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

허용 : 건설

public void methodA(String[] a); 
0

시도 :

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

허용되지 않습니다 더 발견은 허용되지 서명 에 문자열 배열을 정의 할 수 없습니다 --debug 옵션을 사용하고 "찾고있는 유형이 될 수 있으므로, 다음과 같이 선언해야합니다. 안으로, 밖으로 또는 inout. "

0

나는 같은 종류의 오류에 직면했다. 그 이유는 서비스에 액세스하는 클라이언트 응용 프로그램에 복사하는 .aidl 파일이 적절한 패키지 아래에 있지 않기 때문입니다. 패키지를 만들고 응용 프로그램의 적절한 패키지 이름으로 aidl 파일을 복사하십시오.

0

나는 왼쪽 탐색 모음하고있는 ***. AIDL. 시도 siva35 @

관련 문제