报错修改:Failed to query the value of task 'xx:compileDebugJavaWithJavac' property 'options.generated...

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.gradleclasspathgradle文件夹下gradle-wrapper.properties文件里的distributionUrl配置不匹配,所以修改的方式有两种,一种是修改distributionUrl