Repository navigation
fix(build): resolve Robolectric SDK jars through Gradle - #2040
Merged
Merged
Conversation
Flipcash2's test job failed in every class pinned to @config(sdk = [34]) with AssertionError at MavenArtifactFetcher.java:129: Robolectric's download of the android-all jar failed inside the test JVM. Neither workflow caches ~/.m2, so each run downloads these jars again. Gradle now resolves the android-all-instrumented jars for SDK 24, 32, 34, 35 and 36, and each Test task writes a robolectric-deps.properties pointing Robolectric at them. The jars land in the Gradle dependency cache that CI already restores. An SDK missing from the list fails with "no artifacts found for DependencyJar{...}" instead of downloading. The convention plugins call the helper; the app, which applies none of them, gets it through a new flipcash.robolectric.sdks plugin. Dependabot ignores the jars, since each pin is the build a Robolectric release loads for one SDK level.
bmc08gt
added a commit
that referenced
this pull request
Nov 26, 2026
…2051) * fix(build): fetch Robolectric android-all jars from Google's Central mirror The Flipcash2 Build and Deploy run after #2040 failed while storing the configuration cache: Maven Central answered the android-all-instrumented 14-robolectric-10818077-i7 jar request with 429 Too Many Requests. The setup-java Gradle cache restored, but it held no android-all jars, so the run had to download them. Gradle now looks up org.robolectric:android-all-instrumented on maven-central.storage-download.googleapis.com before mavenCentral(). The filter covers that one module, so every other dependency still resolves from Central. All five pinned SDK jars and poms are on the mirror; a missing one falls through to Central. * fix(build): try Google's Central mirror before Central everywhere The android-all filter left every other Central download exposed, and CI kept hitting 429s on them. 2051's unit-test and OCP SDK jobs failed resolving kotlin-gradle-plugin-annotations:2.4.21 for build-logic's kotlin-dsl, which the plugin portal redirects to repo.maven.apache.org. 2052 failed on nativeruntime-dist-compat:1.0.20 and the android-all jar. The mirror now sits ahead of mavenCentral() with no content filter in both settings blocks, the root buildscript, build-logic and buildSrc. build-logic and buildSrc gain a pluginManagement block because their default is the plugin portal alone. An artifact the mirror lacks 404s and falls through: portal-only plugins such as kotlin-dsl and foojay-resolver do that now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flipcash2's
testjob failed in every class pinned to@Config(sdk = [34])(core, core-ui, features:balance), each inclassMethodwithAssertionError at MavenArtifactFetcher.java:129. Robolectric downloads the android-all jar for an SDK level from inside the test JVM, and that download failed. Classes on SDK 36 in the same tasks passed. Neither workflow caches~/.m2, so every run downloads these jars again. The log doesn't show why the download fails on runners.Gradle now resolves
org.robolectric:android-all-instrumentedfor each SDK level the tests run on, and each Test task writes arobolectric-deps.propertiesthat points Robolectric at those files. The jars land in the Gradle dependency cache, which CI already restores.libs/test-utils'robolectric.properties), 32, 34 and 35 (@Config), and 24, Robolectric's default forflipcash.kmp.librarymodules, which don't have test-utils on the classpath.PathSensitivity.NAME_ONLY, so where the Gradle cache sits on a machine doesn't change the cache key.no artifacts found for DependencyJar{...}instead of downloading. A Robolectric bump that renames its jars has to update the pins inlibs.versions.toml.AndroidLibraryConventionPlugin,KmpAppLibraryConventionPluginandKmpLibraryConventionPlugincall the helper. The app applies none of them, so it gets it through a newflipcash.robolectric.sdksplugin.android-all-instrumented: each pin is the build one Robolectric release loads for one SDK level, and "newer" versions belong to other levels.Removing the SDK 34 entry made the SDK 34 classes fail with
no artifacts found, and removing SDK 35 did the same for the app'sAndroidWiringTest, so tests read the mapping rather than~/.m2.