Android Studio Preview 4.1 Canary 10中的构建错误

时间:2020-06-02 13:08:17

标签: android android-studio build.gradle gradle-dependencies

我正在尝试使用Android Studio 4.1 Canary 10开发应用程序,但是每次抛出构建失败。以下是错误。

任务':app:generateDebugBuildConfig'的执行失败。

无法获取E:\ example \ exampleapp \ app \ build \ generated \ source \ buildConfig \ debug的文件详细信息:无法提供文件属性(错误号87)

build.gradle文件

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 {
    classpath "com.android.tools.build:gradle:4.1.0-alpha10"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

我确实清理并重建了没有帮助的项目。任何帮助都很好

谢谢

1 个答案:

答案 0 :(得分:0)

我无法复制主题问题。并且由于新手信誉评分-评论部分仅适用于我的帐户。因此,我发布了答案。请尽量避免怪我。

尝试将以下内容添加到应用程序build.gradle文件中:

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

buildTypes { … }块之前。