Publish only a single variant of Android driver
See original GitHub issueSQLDelight Version
2.0.0-alpha04
Operating System
Linux
Gradle Version
7.4.2
Kotlin Version
1.7.20
Dialect
SQLite
AGP Version
7.3.0
Describe the Bug
I just upgraded to 2.x (2.0.0-alpha04) and everything is working fine for debug/release build variants, but the project I’m working on also has two additional build types (selfSignedRelease
for GH action auto-builds, and googlePlayRelease
with changed app id suffix to workaround a squatter), and both of them are failing. I attached default Gradle output, and the best way to reproduce it is to clone that FOSS project and run ./gradlew clean assSelfSignedRelease
(the cert is included in the repo so there is no additional setup required).
Stacktrace
Executing tasks: [:app:bundleGooglePlayRelease] in project /home/igor/projects/btcmap-android
> Task :app:preBuild UP-TO-DATE
> Task :app:preGooglePlayReleaseBuild UP-TO-DATE
> Task :app:buildKotlinToolingMetadata UP-TO-DATE
> Task :app:generateGooglePlayReleaseFeatureMetadata
> Task :app:checkGooglePlayReleaseDuplicateClasses FAILED
> Task :app:compileGooglePlayReleaseAidl NO-SOURCE
> Task :app:compileGooglePlayReleaseRenderscript NO-SOURCE
> Task :app:dataBindingMergeDependencyArtifactsGooglePlayRelease FAILED
> Task :app:generateGooglePlayReleaseResValues
> Task :app:generateGooglePlayReleaseResources
> Task :app:mergeGooglePlayReleaseResources FAILED
> Task :app:generateGooglePlayReleaseBuildConfig
> Task :app:generateSafeArgsGooglePlayRelease
> Task :app:checkGooglePlayReleaseAarMetadata FAILED
> Task :app:mapGooglePlayReleaseSourceSetPaths FAILED
> Task :app:createGooglePlayReleaseCompatibleScreenManifests
> Task :app:extractDeepLinksGooglePlayRelease
> Task :app:processGooglePlayReleaseMainManifest FAILED
> Task :app:javaPreCompileGooglePlayRelease
> Task :app:extractProguardFiles
> Task :app:processGooglePlayReleaseJavaRes NO-SOURCE
> Task :app:mergeGooglePlayReleaseShaders
> Task :app:compileGooglePlayReleaseShaders NO-SOURCE
> Task :app:generateGooglePlayReleaseAssets UP-TO-DATE
> Task :app:mergeGooglePlayReleaseAssets FAILED
> Task :app:mergeGooglePlayReleaseJniLibFolders
> Task :app:mergeGooglePlayReleaseNativeLibs FAILED
> Task :app:writeGooglePlayReleaseAppMetadata
> Task :app:mergeGooglePlayReleaseArtProfile FAILED
> Task :app:collectGooglePlayReleaseDependencies FAILED
> Task :app:validateSigningGooglePlayRelease
> Task :app:parseGooglePlayReleaseIntegrityConfig
> Task :app:generateGooglePlayReleaseDatabaseInterface
FAILURE: Build completed with 10 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkGooglePlayReleaseDuplicateClasses'.
> Could not resolve all files for configuration ':app:googlePlayReleaseRuntimeClasspath'.
> Could not resolve app.cash.sqldelight:android-driver:2.0.0-alpha04.
Required by:
project :app
> No matching variant of app.cash.sqldelight:android-driver:2.0.0-alpha04 was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'googlePlayRelease', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'debugVariantMavenApiPublication' capability app.cash.sqldelight:android-driver:2.0.0-alpha04:
- Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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 app.cash.sqldelight:android-driver:2.0.0-alpha04 declares a runtime of a component:
- 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 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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 app.cash.sqldelight:android-driver:2.0.0-alpha04 declares a runtime of a component:
- 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 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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 app.cash.sqldelight:android-driver:2.0.0-alpha04 declares a runtime of a component:
- 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 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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 app.cash.sqldelight:android-driver:2.0.0-alpha04:
- Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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 app.cash.sqldelight:android-driver:2.0.0-alpha04 declares a runtime of a component:
- 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 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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 app.cash.sqldelight:android-driver:2.0.0-alpha04 declares a runtime of a component:
- 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 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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 app.cash.sqldelight:android-driver:2.0.0-alpha04 declares a runtime of a component:
- 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 'googlePlayRelease'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '7.3.0')
- 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')
* Try:
> 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.
==============================================================================
...
BUILD FAILED in 1s
25 actionable tasks: 24 executed, 1 up-to-date
Gradle Build Script
https://github.com/teambtcmap/btcmap-android/commit/3c270b01ae3c22887987cc31239706fc03911733
Issue Analytics
- State:
- Created a year ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Configure publication variants | Android Developers
Publication variants let you create a more customized experience for your users. Configuring publication variants lets you publish different ...
Read more >Configure build variants | Android Developers
Find out how you can configure build variants to create different versions of your app from a single project.
Read more >Publishing - Android Developers
In single variant publishing, Android Gradle Plugin creates a component for the variant you want to publish in your app or library module....
Read more >Version your app - Android Developers
Versioning is a critical component of your app upgrade and maintenance strategy.
Read more >Publish your library - Android Developers
Publishing an Android library involves preparing it for release, configuring publication variants and test fixtures, and distributing it.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we can stop publishing two variants and only publish one. That way it will match all variants by default. We were forced to publish two for a while, but newer versions of AGP fixed it where we only need one.
I tried to configure it but the publishing plugin we use doesn’t want to honor it. Leaving it open for someone else to fight with.