Upgraded to Android studio 3.4 - Aapt2InternalException: AAPT2: Daemon startup failed

后端 未结 8 615
情深已故
情深已故 2020-11-27 17:42

I got Error in new project while build after i upgraded Android studio to 3.4

Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed

相关标签:
8条回答
  • 2020-11-27 18:03

    For no reason, ./gradlew clean build -x lint -x testfix the issue while ./gradlew clean assembleDebug did not and reproduce the issue.

    0 讨论(0)
  • 2020-11-27 18:08

    I am also facing this issue. I have tried all the above answers but not working. I have checked these are the questions and their answers. Question 1, Question 2, Question 3 and I have tried to install Windows Universal C Runtime library also.

    I have tried to set the Gradle plugin version 3.5.0 and Gradle version 5.1.0 or 5.6.1 but then also not working. I have checked this google tracker issue also then also not got the answer.

    After spending almost 6 to 7 hours I got the solution and it is below:

    1. Android Studio 3.6.2
    2. Gradle Plugin Version 3.3.2
    3. Gradle version 4.10.3

    Project level build.gradle file:

    buildscript {
    
        repositories {
            google()
            jcenter()
    
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.3.2'
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
    
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    This is gradle-wrapper.property file:

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
    

    I hope someone will get help.

    0 讨论(0)
  • 2020-11-27 18:10

    When building on Jenkins, if GRADLE_USER_HOME is not specified, it will try to dump the Gradle cache in System32 folder which causes this issue. Changing to a different directory via System Environment variable resolves the issue.

    0 讨论(0)
  • 2020-11-27 18:17

    Project level gradle update classpath:

    classpath 'com.android.tools.build:gradle:3.4.0'
    

    gradle-wrapper.properties update distributionUrl:

    distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
    

    After these steps delete .iml file from your project directory and rebuild the project For further detail please see attached image

    0 讨论(0)
  • 2020-11-27 18:21
    1. Go to File->Project-Structure->Project Change Android Gradle Plugin Version to 3.3.2 or the last stable version for you Let the Gradle
      Version to 5.1.1 Click Ok and sync

    it was working but it not use updated gradle 3.4.0

    enter image description here

    0 讨论(0)
  • 2020-11-27 18:25

    You might consider disabling the aaptOptions like the following. Add this in the android section in your build.gradle file.

    android {
        aaptOptions.cruncherEnabled = false
        aaptOptions.useNewCruncher = false
    }
    

    And add the following line in your gradle.properties file.

    android.enableAapt2=false
    
    0 讨论(0)
提交回复
热议问题