1:错误:任务':app:compileDebugAidl'
的执行失败。
java.lang.RuntimeException:com.android.ide.common.process.ProcessException:执行进程C时出错:\ Users \ pc \ AppData \ Local \ Android \ Sdk \ build-tools \ 26.0.1 \ aidl。 exe参数{-pC:\ Users \ pc \ AppData \ Local \ Android \ Sdk \ platforms \ android-25 \ framework.aidl -oC:\ android projects \ BatterySaver \ app \ build \ generated \ source \ aidl \ debug - IC:\ android projects \ BatterySaver \ app \ src \ main \ aidl -IC:\ android projects \ BatterySaver \ app \ src \ debug \ aidl -IC:\ Users \ pc.android \ build-cache \ 10165b4e57f66418e205d5742ddc6db035c2806c \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ 154745c6bf28dc8cec28a1210e67c2136a8f7b86 \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ 793c1faa6135c81eb9ad18150702f0e5e18b6df1 \ output \ aidl -IC:\ Users \ pc.android \ build- cache \ 09219873fd9a721e03835be866643cd14a5a3343 \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ 0557b7bd7d0a1971131eaf82c18302dd2f710525 \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ d554cea8cfcff99b59c55b9c84b59a03608974 \ output \ aidl -IC:\ Users \ pc.android \构建-CA che \ 14c91e4bc7e29da9d16eeaf6de09834957ead976 \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ 42b7add12d52f4efbe9f1f0d9bc59e8fd29da51d \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ d9c3b42d33c9318a7cf37436ef896e51b93e514b \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ cb88c931fa35c7a340439ccc5a25f170d4f7d032 \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ a69967b0de5e346deababb4c575aa3d71b71fbe5 \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ 52e40ef3ed71f66ed5dcd284a3bd9e6870e3aac8 \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ 89c55143b283f991c28fa941c1db8a40c2d5bdbe \ output \ aidl -IC:\ Users \ pc.android \ build-cache \ c425aed4a8f6404a94152f1eb24265c5249e456d \ output \ aidl -dC:\ Users \ pc \ AppData \ Local \ Temp \ aidl3023659222478796510.d C:\ android projects \ BatterySaver \ app \ src \ main \ aidl \ com \ ahchtar \ battery_saver \ IBattery.aidl}
2:我的傻瓜:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.xx.app"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName " "
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
aidl.srcDirs = ['src/main/aidl']
}
}
repositories {
mavenCentral()
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
//noinspection AndroidLintGradleCompatible
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.google.android.gms:play-services-analytics:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:0)
您需要为compileSdkVersion
,buildToolsVersion
和targetSdkVersion
使用相同的版本API。您还需要添加versionName而不是空白。如果您想要定位API级别16,请将它们更改为以下内容:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.xx.app"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
}
...
}
答案 1 :(得分:0)
我想,你可以点击 Gradle console ,你会看到真正的原因, 我遇到一个问题是32位libgcc_s.so文件泄漏,如下所示:
:compileDebugAidl /opt_dev/android-sdk-linux_new/build-tools/23.0.3/aidl:加载共享库时出错:libgcc_s.so.1:无法打开共享对象文件:没有这样的文件或目录
/opt_dev/android-sdk-linux_new/build-tools/23.0.3/aidl:加载共享库时出错:libgcc_s.so.1:无法打开共享对象文件:没有这样的文件或目录
FAILED
/opt_dev/android-sdk-linux_new/build-tools/23.0.3/aidl:加载共享库时出错:libgcc_s.so.1:无法打开共享对象文件:没有这样的文件或目录
/opt_dev/android-sdk-linux_new/build-tools/23.0.3/aidl:加载共享库时出错:libgcc_s.so.1:无法打开共享对象文件:没有这样的文件或目录
失败:构建因异常而失败。
java.lang.RuntimeException:com.android.ide.common.process.ProcessException:
所以在Ubuntu 16.04 LTS上运行以下命令: sudo apt-get install lib32gcc1