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
Multiple transformed artifacts selected #15536
Comments
Should be fixed now via #15637 |
@adammurdoch , thanks for fixing this bug. I'm wondering if it would be possible to cherry pick this into 6.8 . In case it cannot be cherry picked, wondering when will the next RC be cut. Thanks! |
+1 to cherrypicking into 6.8. For us, upgrading to 7.0 is going to take a while as we need to audit and update all our gradle plugins to remove usages of deprecated features. |
Same here, please backport |
We also ran into this issue just now. We'd also appreciate a backport, if possible. |
Also seeing this in production, please backport this to 6.8.
tasks.named('mergeExtDexDebugAndroidTest').configure {
mustRunAfter tasks.named('mergeExtDexDebug')
} but it would be much better to have a fix it in Gradle. |
I can reproduce with 6.8.3 (seems ok on 7.0 RC2 + AGP Do you confirm it's not part of 6.8? Can't make @alaershov's 2nd suggestion work though :( |
I have wasted simply too much time on this. If anyone else searching for this and wondering where @alaershov's 2nd suggestion should be placed, see here https://github.com/alaershov/android-merge-ext-dex-bug-sample/blob/master/app/build.gradle#L75 Or more specifically add at the end in // @TODO: See https://github.com/gradle/gradle/issues/15536
gradle.projectsEvaluated {
tasks.named('mergeExtDexDebugAndroidTest').configure {
mustRunAfter tasks.named('mergeExtDexDebug')
}
} |
I think this is more complete. The build was working locally in debug mode but not in release mode on pipeline. // @TODO: See https://github.com/gradle/gradle/issues/15536
gradle.projectsEvaluated {
if (tasks.findByName('mergeExtDexDebugAndroidTest')) {
// In case of building assembleAndroidTest debug.
tasks.named('mergeExtDexDebugAndroidTest').configure {
mustRunAfter tasks.named('mergeExtDexDebug')
}
} else {
// In case of building assembleAndroidTest release.
tasks.named('mergeExtDexDebug').configure {
mustRunAfter tasks.named('mergeExtDexDebugAndroidTest')
}
}
} |
Confirming the fix for those of you stuck on 6.x. Good work @archfz 👍 Here's the diff FYI:
|
Actually the fix is not working consistently for me, we do have both build debug and release for android test, on pipeline it's stiff failing and I am having a very difficult time understanding the issue. That is why I opted to cherry pick the fix from 7.x, lets hope gradle team releases it soon into 6.x |
@archfz should the else branch be using |
@mrbrentkelly Indeed something like that would sound logical, but this is my current version and I still have issues.
|
Thanks @archfz 👍 I've tried a few different things and this is what appears to be working best for me... gradle.projectsEvaluated {
if (tasks.findByName('mergeExtDexRelease') && tasks.findByName('mergeExtDexReleaseAndroidTest')) {
tasks.named('mergeExtDexRelease').configure {
mustRunAfter tasks.named('mergeExtDexReleaseAndroidTest')
}
}
if (tasks.findByName('mergeExtDexDebugAndroidTest') && tasks.findByName('mergeExtDexDebug')) {
tasks.named('mergeExtDexDebugAndroidTest').configure {
mustRunAfter tasks.named('mergeExtDexDebug')
}
}
} |
Suspicion is that 6.9.0 contains a bug causing one of our CI steps to fail sporadically (e.g. https://github.com/digidem/mapeo-mobile/runs/4968297075?check_suite_focus=true). Potentially relevant issue was reported (gradle/gradle#15536) and apparently has been addressed (gradle/gradle#18572). According to gradle/gradle#18572 (review), looks like the fix was backported to 6.9.2
Suspicion is that 6.9.0 contains a bug causing one of our CI steps to fail sporadically (e.g. https://github.com/digidem/mapeo-mobile/runs/4968297075?check_suite_focus=true). Potentially relevant issue was reported (gradle/gradle#15536) and apparently has been addressed (gradle/gradle#18572). According to gradle/gradle#18572 (review), looks like the fix was backported to 6.9.2
Suspicion is that 6.9.0 contains a bug causing one of our CI steps to fail sporadically (e.g. https://github.com/digidem/mapeo-mobile/runs/4968297075?check_suite_focus=true). Potentially relevant issue was reported (gradle/gradle#15536) and apparently has been addressed (gradle/gradle#18572). According to gradle/gradle#18572 (review), looks like the fix was backported to 6.9.2
Using duplicates.zip project and running
./gradlew :app:mergeExtDexDebugAndroidTest :app:mergeExtDexDebug
(it is important to run tasks in the same Gradle invocation) fails with Gradle 6.7+ becausedebug
runtime classpath contains unexpected artifacts. This succeeds with Gradle 6.6.1.When building
debugAndroidTest
variant, we do the following:debugAndroidTest
runtime classpath withartifactType=android-dex
, this isA
debug
runtime classpath withartifactType=android-dex
, this isB
A
that are not found inB
(this is needed in order to avoid duplicate classes in test and main APK)Because desugaring is enabled, some artifacts e.g
lifecycle-livedata-core-2.2.0
will be dexed twice. Two output artifacts will be produced, as dependency graphs fordebug
anddebugAndroidTest
differ. However, this should only result in havinglifecycle-livedata-core-2.2.0
DEX in both APKs, and it should not result in having these two versions in thedebug
runtime classpath.Workarounds include:
minSdkVersion
inapp/build.gradle
to 24+The text was updated successfully, but these errors were encountered: