After upgrading from 2.2 to 2.3 I see this warning
and when I try to compile the project I see this compilation error
How can i solve this issue without downgrading to a previous gradle version? Is there any update of android-apt that can solve this issue?
2 Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
If you don't really need the mechanism, just specify a random flavor dimension:
android {
...
flavorDimensions "default"
...
}
For more information, check the migration guide
3. Android Studio 3.0 Compile Issue (Cannot choose between Configurations)
Issue with latest 3.0 build (Beta 2) My project has 1 sub module by a 3rd party so I only have access to their build.gradle.
My project has 3 flavours, snap, uat, production. Each has 2 build types, debug and release. When I try build I get this.
Error:Cannot choose between the following configurations of project :lp_messaging_sdk:
- debugApiElements
- debugRuntimeElements
- releaseApiElements
- releaseRuntimeElements
All of them match the consumer attributes:
- Configuration 'debugApiElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
- Found org.gradle.api.attributes.Usage 'java-api' but wasn't required.
- Configuration 'debugRuntimeElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
- Found org.gradle.api.attributes.Usage 'java-runtime' but wasn't required.
- Configuration 'releaseApiElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
- Found org.gradle.api.attributes.Usage 'java-api' but wasn't required.
- Configuration 'releaseRuntimeElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
- Found org.gradle.api.attributes.Usage 'java-runtime' but wasn't required.
解决方案
dependencies {
// If the library configures multiple build variants using product flavors,
// you must target one of the library's variants using its full configuration name.
compile project(':lp_messaging_sdk')
改为 demoDebugCompile project(path: ':lp_messaging_sdk', configuration: 'demoDebug') fullReleaseCompile project(path: ':lp_messaging_sdk', configuration: 'fullRelease') ...}