簡體   English   中英

錯誤:任務':app:compileDebugAidl'的執行失敗

[英]Error:Execution failed for task ':app:compileDebugAidl'

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: \\用戶\\ pc.android \\建立緩存\\ 154745c6bf28dc8cec28a1210e67c2136a8f7b86 \\輸出\\ AIDL -IC:\\用戶\\ pc.android \\建立緩存\\ 793c1faa6135c81eb9ad18150702f0e5e18b6df1 \\輸出\\ AIDL -IC:\\用戶\\ pc.android \\建立緩存\\ 09219873fd9a721e03835be866643cd14a5a3343 \\ output \\ aidl -IC:\\ Users \\ pc.android \\ build-cache \\ 0557b7bd7d0a1971131eaf82c18302dd2f710525 \\ output \\ aidl -IC:\\ Users \\ pc.android \\ build-cache \\ d554cea8cfcff99b59c55b9c8b84b59a03608974 \\ Output \\ aidl -IC:機器人\\構建緩存 \\ 14c91e4bc7e29da9d16eeaf6de09834957ead976 \\輸出\\ AIDL -IC:\\用戶\\ pc.android \\建立緩存\\ 42b7add12d52f4efbe9f1f0d9bc59e8fd29da51d \\輸出\\ AIDL -IC:\\用戶\\ pc.android \\建立緩存\\ d9c3b42d33c9318a7cf37436ef896e51b93e514b \\輸出\\ AIDL -IC:\\用戶\\ pc.android \\ build-cache \\ cb88c931fa35c7a340439ccc5a25f170d4f7d032 \\ output \\ aidl -IC:\\ Users \\ pc.android \\ build-cache \\ a69967b0de5e346deababb4c575aa3d71b71fbe5 \\ output \\ aidl -IC:\\ Users \\ pc.android.9 \\ e3b \\ d3b71f71d7d3d71b71fbe5ed。輸出aidl -IC:\\ Users \\ pc.android \\ build-cache \\ 89c55143b283f991c28fa941c1db8a40c2d5bdbe \\ output \\ aidl -IC:\\ Users \\ pc.android \\ build-cache \\ c425aed4a8f6404a94152f1eb24265c5249e456d \\ output \\ aidl -dC:\\ Data \\ Local \\ Temp \\ aidl3023659222478796510.d C:\\ android項目\\ BatterySaver \\ app \\ src \\ main \\ aidl \\ com \\ ahchtar \\ battery_saver \\ IBattery.aidl}

2:我的gradle:

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'

您需要對compileSdkVersionbuildToolsVersiontargetSdkVersion使用相同版本的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

    }
    ...
}

我認為,您可以單擊Gradle控制台 ,您將看到真正的原因,我遇到的一個問題是32bit 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:無法打開共享庫文件:沒有這樣的文件或目錄

失敗

/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:無法打開共享庫文件:沒有這樣的文件或目錄

失敗:構建失敗,發生異常。

  • 出了什么問題:任務':compileDebugAidl'的執行失敗。

    java.lang.RuntimeException:com.android.ide.common.process.ProcessException:

因此在Ubuntu 16.04 LTS上,運行以下命令:sudo apt-get install lib32gcc1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM