Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versions 4.3 and 5.0 don't work with custom build types, but version 4.2 did! #178

Open
fulcrum6378 opened this issue Jun 23, 2023 · 2 comments

Comments

@fulcrum6378
Copy link

First of all, thank you for developing such a useful utility. I've been using it for a year.

Because of some app signing reasons I had to make a very simple custom build type: "debuggee" instead of "debug". Like this:

    defaultConfig {
        ...
        signingConfig signingConfigs.main
    }
    buildTypes {
        debuggee {
            debuggable true
            minifyEnabled false
        }
        release {
            ...
        }
    }

At first I used the version 4.2 and everything was fine.
But when you released the versions 4.3 and even 5.0 and I upgraded, I always encountered a weird error in the assembleDebugee Gradle process (not the initial build).
It's been months since I encounter this error, therefore I downgraded it to 4.2 and suppressed the upgrade warning using "//noinspection GradleDependency".

Summary:

Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebuggee'.
> Could not resolve all files for configuration ':app:debuggeeCompileClasspath'.
   > Could not resolve com.tbuonomo:dotsindicator:5.0.
     Required by:
         project :app
      > No matching variant of com.tbuonomo:dotsindicator:5.0 was found. The consumer was configured to find a component for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.0.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - Variant 'debugVariantMavenApiPublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during compile-time:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'debugVariantMavenJavaDocPublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'debugVariantMavenRuntimePublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'debugVariantMavenSourcePublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseVariantMavenApiPublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during compile-time:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseVariantMavenJavaDocPublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseVariantMavenRuntimePublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseVariantMavenSourcePublication' capability com.tbuonomo:dotsindicator:5.0 declares a component for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debuggee'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')

Here's a complete log of the assembleDebuggee Gradle process:
build log.txt


There is also a weird warning every time I switch between build types, no matter it is release, debug or debuggee:
warning.txt

Thank you again.

@f0rev
Copy link

f0rev commented Jun 24, 2023

Same here...

@fulcrum6378
Copy link
Author

Oh I didn't see this issue before: #170

At least I know when this happened, which is when the project version went from 4.2 to 4.3.

I compared the related commits to v4.2 and v4.3 releases and the only Gradle-related changes that had been done were 2 things:

  1. Gradle config files were migrated from Groovy to Kotlin DSL (which don't seem to have caused this problem)
  2. AGP version 4.1.3 was upgraded to 7.1.3 and "gradle-6.6-all.zip" to "gradle-7.4.2-bin.zip".

Here's another guy in StackOverflow with the same situation (the 2nd one above) and the same problem:
https://stackoverflow.com/questions/64758477/android-buildtypes-vs-productflavors-error
The guy had upgraded from AGP 3.5.x to 4.10 (and to Gradle 6.5).
So it seems that it would throw the same error on a custom build flavor too!!

Using this guide, I found a solution for the module which implements a custom build variant:
https://developer.android.com/build/build-variants#resolve_matching_errors

    buildTypes {
        create("debuggee") {
            ...
            matchingFallbacks += listOf("debug")
        }
    }
    buildTypes {
        debuggee {
            ...
            matchingFallbacks = ['debug']
        }
    }

But is there a solution for the library NOT TO REQUIRE ALL THESE EFFORTS, just like the other libraries?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants