简体   繁体   中英

Build Error in Android Studio Preview 4.1 Canary 10

I am trying to work on an application using Android Studio 4.1 Canary 10 but every time it throws build failed. Following is the error.

Execution failed for task ':app:generateDebugBuildConfig'.

Could not get file details of E:\example\exampleapp\app\build\generated\source\buildConfig\debug: could not file attributes (errno 87)

build.gradle file

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
    applicationId "com.example.exampleapp"
    minSdkVersion 24
    targetSdkVersion 29
    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
}
kotlinOptions {
    jvmTarget = '1.8'
}
buildFeatures {
    compose true
}

}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.ui:ui-framework:0.1.0-dev09'
implementation 'androidx.ui:ui-layout:0.1.0-dev09'
implementation 'androidx.ui:ui-material:0.1.0-dev09'
implementation 'androidx.ui:ui-tooling:0.1.0-dev09'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

classpath dependencies:

  dependencies {
    classpath "com.android.tools.build:gradle:4.1.0-alpha10"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

I did clean and rebuild the project it didn't help. Any help would be great

Thank you

I couldn't to reproduce topic issue. And due to newbie reputation score — comment-section read only for my account now. So I post the answer. Avoid blaming me if it possible, please.

Try to add to application build.gradle file following:

composeOptions {
        kotlinCompilerVersion "1.3.70-dev-withExperimentalGoogleExtensions-20200424"
        kotlinCompilerExtensionVersion "0.1.0-dev09"
    }

just before buildTypes { … } block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM