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

后端 未结 8 616
情深已故
情深已故 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:25

    Use this build.gradle in your project

    
    apply plugin: 'kotlin-android'
    
    apply plugin: 'kotlin-android-extensions'
    
    android {
        compileSdkVersion 28
        defaultConfig {
            applicationId "com.fileobserver"
            minSdkVersion 21
            targetSdkVersion 28
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }
    
    Top level build.gradle downgrade version 
    buildscript {
        ext.kotlin_version = '1.3.31'
        repositories {
            google()
            jcenter()
    
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.3.2'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    0 讨论(0)
  • 2020-11-27 18:26

    I had a same problem. Currently,the best option is to downgrade your class path to the last stable version. For me, i changed my class path to *classpath 'com.android.tools.build:gradle:3.3.2'*and it worked for me. In Android studio 3.4, you can easily downgrade Android Gradle Plugin Version.

    1. Go to File->Project-Structure->Project
    2. Change Android Gradle Plugin Version to 3.3.2 or the last stable version for you
    3. Change the Gradle Version to 4.10.1
    4. Click Ok and sync
    5. Build Apk

    Edit (Issue solved): Installing Service pack 1 for window 7 solved the issue. The problem was with Universal C Runtime in Windows.

    0 讨论(0)
提交回复
热议问题