AndoridStudio3.0 import Module 错误解决

更新AndroidStudio3.0后,我就随便想写写一些demo,然后写一些Module提供一些基础功能,结果报错:

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :testmoudle.

点击show Details 就显示

Unable to find a matching configuration of project :testmoudle:
     - Configuration 'debugApiElements':
         - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
         - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'.
         - 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'.
......

哎呀,我也就默认的进行建立一个Module,然后主app进行implementation,没做其他,而且这些都是空项目,怎么会报错,这个坑好大....

原来默认的Module的build.gradle中是写apply plugin: 'com.android.application'的,我们改为apply plugin: 'com.android.library',然后把applicationId "com.xxx" 这个包名的声明删掉就好了.

你可能感兴趣的:(AndoridStudio3.0 import Module 错误解决)