Skip to content

Commit dc9a9b8

Browse files
committed
android-interop-testing: Workaround build mergeExtDexDebug race
4de4718 upgraded android-interop-testing to SDK version 23, but this had previously been avoided because it triggered a Gradle or AGP bug. The race happened to not trigger locally or for the PR's CI and the change was merged. But the problem still was present, and the CI is failing to build very frequently. This works around the problem by explicitly adding a dependency from mergeExtDexDebug. I didn't see any other mergeExtDex tasks created, in particular mergeExtDexRelease. Hopefully we can remove this after upgrading AGP or Gradle, but at least we can move forward with newer Android API levels again.
1 parent 4de4718 commit dc9a9b8

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

android-interop-testing/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ tasks.withType(JavaCompile).configureEach {
111111
"|")
112112
}
113113

114+
// Workaround error seen with Gradle 8.14.3 and AGP 7.4.1 when building:
115+
// ./gradlew clean :grpc-android-interop-testing:build -PskipAndroid=false \
116+
// -Pandroid.useAndroidX=true --no-build-cache
117+
//
118+
// Error message:
119+
//
120+
// Execution failed for task ':grpc-android-interop-testing:mergeExtDexDebug'.
121+
// > Could not resolve all files for configuration ':grpc-android-interop-testing:debugRuntimeClasspath'.
122+
// > Failed to transform opencensus-contrib-grpc-metrics-0.31.1.jar (io.opencensus:opencensus-contrib-grpc-metrics:0.31.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
123+
// > Could not resolve all files for configuration ':grpc-android-interop-testing:debugRuntimeClasspath'.
124+
// > Failed to transform grpc-api-1.81.0-SNAPSHOT.jar (project :grpc-api) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
125+
// > Execution failed for IdentityTransform: grpc-java/api/build/libs/grpc-api-1.81.0-SNAPSHOT.jar.
126+
// > File/directory does not exist: grpc-java/api/build/libs/grpc-api-1.81.0-SNAPSHOT.jar
127+
tasks.configureEach { task ->
128+
if (task.name.equals("mergeExtDexDebug")) {
129+
dependsOn(':grpc-api:jar')
130+
}
131+
}
132+
114133
afterEvaluate {
115134
// Hack to workaround "Task ':grpc-android-interop-testing:extractIncludeDebugProto' uses this
116135
// output of task ':grpc-context:jar' without declaring an explicit or implicit dependency." The

0 commit comments

Comments
 (0)