升级AndroidStudio3.0 Unable to resolve dependency for ':app@betaUnitTest/compileClasspath': Could not
2017-11-02 17:56
507 查看
AndroidStudio3.0升级报了下面的错误:
分析了错误日志,和BuildType有关,“beta”、“debug”。
导入的library项目名为ptr,build.gradle的:
App的build.gradle是这样的:
对比发现确实是少了这两个,重新修改library的build.gradle,如下:
重新Build一下项目,就好了。
Unable to resolve dependency for ':app@betaUnitTest/compileClasspath': Could not resolve project :ptr. Could not resolve project :ptr. Required by: project :app > Unable to find a matching configuration of project :ptr: - Configuration 'debugApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'beta' and found incompatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. - Configuration 'debugRuntimeElements': - Required com.android.build.api.attributes.BuildTypeAttr 'beta' and found incompatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'. - Configuration 'releaseApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'beta' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. - Configuration 'releaseRuntimeElements': - Required com.android.build.api.attributes.BuildTypeAttr 'beta' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'.
分析了错误日志,和BuildType有关,“beta”、“debug”。
导入的library项目名为ptr,build.gradle的:
buildTypes { release { ....//我自己项目中的配置 } }
App的build.gradle是这样的:
buildTypes { debug { ....//我自己项目中的配置 } beta { ....//我自己项目中的配置 } release { ....//我自己项目中的配置 } }
对比发现确实是少了这两个,重新修改library的build.gradle,如下:
buildTypes { debug { ... } beta { ... //关键代码,release, debug为library中已有buildType matchingFallbacks = ['release', 'debug'] } release { ... } }
重新Build一下项目,就好了。
相关文章推荐
- 升级AndroidStudio3.0 Unable to resolve dependency for ':app@betaUnitTest/compileClasspath': Could not
- 升级AndroidStudio3.0 Unable to resolve dependency for ':app@betaUnitTest/compileClasspath问题解决
- 问题解决Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
- Error:Unable to resolve dependency for ':app@stage/compileClasspath': Could not resolve project :mvp
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
- Unable to resolve dependency for ':okgo@debug/compileClasspath': Could not resolve com.squareup.okh
- AS3.0 导入Android库报错 Error:Unable to resolve dependency for ':app@debug/compileClasspath':
- studio3.0关于Error:Unable to resolve dependency for ':@debug/compileClasspath'的解决方案
- Error:Could not resolve all dependencies for configuration ':app:prodDebugCompileClasspath'. Cannot
- Android studio 3.x 报错 : Unable to resolve dependency for ':app@dexOptions/compileC
- Unable to resolve dependency for... Could not resolve project :library
- Unable to resolve dependency for 'xxx项目@debug/compileClasspath': Could not resolve com.jakew
- Error:Unable to resolve dependency for ':module1@debug/compileClasspath': Could not resolve project
- jsp 自定义标签 错误 : Unable to compile class for JSP: ,apache cannot be resolved or is not a field
- Unable to compile class for JSP: Only a type can be imported. com.gao.model.OutputStatistics resolve
- Could not resolve all dependencies for configuration ':classpath'.
- Could not resolve all files for configuration ':classpath'.Could not find com.android.tools.
- Android 异常Error:Unable to resolve dependency ,Could not resolve project
- Could not resolve all dependencies for configuration ':classpath'.