Android Studio: Gradle build fails — Execution failed for task ':compileDebugAidl'

前端 未结 10 1926
孤街浪徒
孤街浪徒 2021-02-06 22:18

After changes to source and building with gradle in Android Studio (I/O preview) AI - 130.677228 the build fails with the following error:

Gradle: 
FAILURE: Buil         


        
相关标签:
10条回答
  • 2021-02-06 22:49

    Can i see gradle (error filtered) output? (toolwindow gradle, gradle tab) Looks like there is problem with functions inside the aidl files, which are mostly for outside application interface, & services. Etc to transfer data to widget, or if you need data transfer between two applications. Second posibility is two libraries with the same aidl structure, just one function is differrent, than one, or you are using the same library twice. Another reason i newer saw with this message

    0 讨论(0)
  • 2021-02-06 22:52

    I was facing the same issue "Failed to execute the task: compileDebugaidl aidl/debug/".

    I saw further in Gradle Console for the specifics and it read as below:

    Failed to capture snapshot of output files for task 'prepareComAndroidSupportAppcompatV72103Library' during up-to-date check.

    Could not remove entry '/Users/..../.../.../..../build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3' from cache outputFileStates.bin (/Users/..../..../..../.gradle/2.2.1/taskArtifacts/outputFileStates.bin).

    I resolved it by deleting the outputFileStates.bin file from the terminal and allowed Gradle to recreate it.

    Hope it helps somebody.

    0 讨论(0)
  • 2021-02-06 23:01

    I'm not sure how this is possible. It looks like you have a mismatch between the Gradle plugin itself and its dependencies that provides the WaitableExecutor class.

    However you mention Gradle 1.5 and this is a problem.

    The plugin version 0.3 was compatible with Gradle 1.3-1.4 The new version release last week, 0.4 is compatible with Gradle 1.6+

    Make sure you use 0.4 and the new Gradle version.

    0 讨论(0)
  • 2021-02-06 23:01

    Please, try checking "Use default gradle wrapper" option in the Project-level settings.

    Android Studio --> File --> Settings --> Build, Execution, Deployment --> Build Tools --> Gradle

    0 讨论(0)
  • 2021-02-06 23:03

    Add:

    compileSdkVersion 17 to your buid.gradel file (below).

    And use version 3 of the plugin: com.android.tools.build:gradle:0.3 (or higher for future questions,etc)

    Edit: reference project I just created. Builds, signs,etc https://github.com/yegdroid/gradle_demo

    //
    // A basic Android application that follows all the conventions
    //
    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.3'
        }
    }
    apply plugin: 'android'
    
    android {
        testBuildType = "debug"
    
        defaultConfig {
            versionCode = 1
            versionName = "0.1"
            minSdkVersion = 9
            targetSdkVersion = 17
    
    
            compileSdkVersion 17
            buildConfig "private final static boolean DEFAULT = true;", \
                        "private final static String FOO = \"foo\";"
        }
    
        buildTypes {
            debug {
                packageNameSuffix = ".debug"
    
                buildConfig "private final static boolean DEBUG2 = false;"
            }
        }
    
        aaptOptions {
            noCompress "txt"
        }
        sourceSets {
              main {
                  manifest {
                      srcFile 'AndroidManifest.xml'
                  }
                  java {
                      srcDir 'src'
                  }
                  res {
                      srcDir 'res'
                  }
                  assets {
                      srcDir 'assets'
                  }
                  resources {
                      srcDir 'src'
                  }
              }
          }
    }
    
    0 讨论(0)
  • 2021-02-06 23:04

    This works for me
    edit in your project build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        repositories {
            jcenter()
            mavenCentral()
        }
        dependencies {
            //delete this line below   
            classpath 'com.android.tools.build:gradle:1.0.1'
            //add this line below
            classpath 'com.android.tools.build:gradle:1.2.3'
        }
    }
    
    0 讨论(0)
提交回复
热议问题