appsweep-gradle icon indicating copy to clipboard operation
appsweep-gradle copied to clipboard

Error when running in multi dimensional flavor setup

Open G00fY2 opened this issue 1 year ago • 2 comments

When running any upload task we get the following error for every Gradle Android module in our app:

- Configuration ':features:orders:orders-local:debugRuntimeElements' variant android-lint-local-aar declares a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.2', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
           - Unmatched attributes:
               - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:distribution (required 'dev')
               - Doesn't say anything about com.android.build.api.attributes.ProductFlavor:platform (required 'google')
               - Provides attribute 'artifactType' with value 'android-lint-local-aar' but the consumer didn't ask for it
               - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it

* Try:
> Ambiguity errors are explained in more detail at https://docs.gradle.org/8.8/userguide/variant_model.html#sub:variant-ambiguity.
> Review the variant matching algorithm at https://docs.gradle.org/8.8/userguide/variant_attributes.html#sec:abm_algorithm.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 4s

Our flavor setup looks like this:

    flavorDimensions += listOf("platform", "distribution")
    productFlavors {
        create("google") {
            dimension = "platform"
        }
        create("huawei") {
            dimension = "platform"
        }
        create("dev") {
            dimension = "distribution"
            applicationIdSuffix = ".app.dev"
        }
        create("stage") {
            dimension = "distribution"
            applicationIdSuffix = ".app.stage"
        }
        create("production") {
            dimension = "distribution"
            applicationIdSuffix = ".mobileapp"
        }
    }

G00fY2 avatar Jun 11 '24 09:06 G00fY2

Hey @G00fY2,

which version of the plugin did you use? We released [1.5.9](https://github.com/Guardsquare/appsweep-gradle/releases/tag/v1.5.9) last Friday which fixed an issue with multiple product flavors.

In any case, it seems you are using Gradle 8.8 here, so this would not work anyway at the moment (see https://github.com/Guardsquare/appsweep-gradle/issues/12)

titze avatar Jun 12 '24 05:06 titze

Hi and thanks for the answer! Sorry, I missed that part. I was using latest version 1.5.9.

G00fY2 avatar Jun 12 '24 06:06 G00fY2