Repository navigation
Commit c9fa044
committed
ADFA-3078: Search the on-device Maven repo before the remote ones
Offline builds failed unless the user turned on the --offline flag, which
defeats the point of an offline-first IDE.
The on-device repo was registered last. Templates declare gradlePluginPortal(),
google() and mavenCentral() first, and this plugin appended with
`maven { it.url = uri }`. With no network, dl.google.com fails DNS, and Gradle
treats a repository *error* as fatal rather than falling through to the next
repository the way it does for a 404. Resolution therefore died at google() and
never reached the local repo. --offline worked only because it skips remote
repositories entirely.
The artifacts were never missing: the AGP plugin marker,
kotlin-build-tools-compat and kotlin-build-tools-impl are all present in
localMvnRepository on device.
Inserting at index 0 instead of appending fixes all four injection points
(pluginManagement, dependencyResolutionManagement, and the settings and project
buildscript blocks).
Verified on a Pixel 9 Pro emulator in airplane mode with offlineMode=false, the
Gradle modules-2 cache deleted, and a brand new Empty Activity Kotlin project
whose settings.gradle.kts was left untouched: sync reaches "Project initialized"
and the build produces app-debug.apk. Both failed under identical conditions
before this change. A warm module cache masks the bug, so retests need the cache
cleared.
Ships in the APK, not the assets zip, so no asset rebuild is required.
Claude-Session: https://claude.ai/code/session_017HGpMsUzZ5wxCfMtDZ2HGP1 parent 02bd363 commit c9fa044
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 119 | + | |
| 120 | + | |
122 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
0 commit comments