FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':lib-sample:compileDebugJavaWithJavac'.
> Failed to query the value of task ':lib-sample:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /Users/name/AndroidStudioProjects/Myproject/lib-sample/build/generated/ap_generated_sources/debug/out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@d9db944) before task ':lib-sample:compileDebugJavaWithJavac' has completed is not supported
* Try:
发生这个错误的原因一般是build.gradle
中classpath
和gradle
文件夹下gradle-wrapper.properties
文件里的distributionUrl
配置不匹配,所以修改的方式有两种,一种是修改distributionUrl
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
另外一种是修改build.gradle中的gradle版本
classpath "com.android.tools.build:gradle:4.0.1"
网友评论