美文网首页
报错修改:Failed to query the value o

报错修改:Failed to query the value o

作者: Erich_Godsen | 来源:发表于2021-10-22 10:47 被阅读0次
    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

    distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
    

    另外一种是修改build.gradle中的gradle版本

    classpath "com.android.tools.build:gradle:4.0.1"
    

    相关文章

      网友评论

          本文标题:报错修改:Failed to query the value o

          本文链接:https://www.haomeiwen.com/subject/fqpcaltx.html