gpt4 book ai didi

android - 错误 :Execution failed for task ':app:compileDebugAidl ProcessException

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:34:48 26 4
gpt4 key购买 nike

我无法构建 Aidl 库。
错误:


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

我受困于这些,尝试过可能的解决方案。

最佳答案

我犯了同样的错误,但我改正了。我猜你想“通过 IPC 传递对象”,我也是。

我的问题是我错过了对象aidl中的包定义,例如Rect.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;

关于android - 错误 :Execution failed for task ':app:compileDebugAidl ProcessException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41461954/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com