Repository navigation
fix(android): make vendored gradle scripts work with Gradle 9.x and AGP 9 - #9
Merged
Merged
Conversation
…GP 9
Gradle 9 and AGP 9 removed or tightened APIs the vendored app and plugin
build scripts relied on:
- Project.exec {} is gone: use an injected ExecOperations (bytecode step)
- subclasses of JavaExec must be abstract (BuildToolTask)
- the kotlin-android plugin conflicts with AGP 9 built-in Kotlin: only
apply it below AGP 9
- groovy-all 3.0.8 on the plugin build classpath clashes with Gradle's
Groovy 4, and jcenter() no longer exists: remove both
- compile classpath jars were declared as plain File inputs, so Gradle
flagged the generated R.jar as an implicit dependency: pass the
filtered FileCollection to keep its task dependencies
- only require validateSigning for the build type being built, so a
debug run does not need a release keystore
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
farfromrefug
marked this pull request as ready for review
October 17, 2026 12:59
farfromrefug
added a commit
to ossappscollective/oss-weather
that referenced
this pull request
Oct 17, 2026
Gradle 9.6+ removed the internal APIs every AGP 8.x relies on, so 9.7.1 requires AGP 9. Needs the matching nativescript-cli vendor script fixes (Akylas/nativescript-cli#9). - Gradle 9.7.1, AGP 9.4.1, androidx baselineprofile plugin 1.5.0 - android.newDsl=false: the build scripts still use applicationVariants, which the AGP 9 DSL removes (temporary opt-out, gone in AGP 10) - run the gradle.properties merge hook before prepareNativeApp, so the licences hook (which runs gradle) already sees android.newDsl - drop the kotlin-android plugin (AGP 9 built-in Kotlin) and the removed kotlinOptions, replace Project.exec with ExecOperations - enable the Gradle build cache (clean release build 35s -> 17s) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Summary
gradle-app/gradle-pluginscripts for Gradle 9.x and AGP 9: replace the removedProject.exec {}, makeBuildToolTaskabstract, dropgroovy-all3.0.8 andjcenter(), and only applykotlin-androidbelow AGP 9.R.jartask dependency when extracting compile classpath jars (Gradle now flags it as an implicit dependency).validateSigningfor the build type being built, so debug runs no longer need a release keystore.Testing
Built a NativeScript app with Gradle 9.7.1 + AGP 9.4.1 (
android.newDsl=false):ns prepare, plugin AARs, debug APK and a signed release APK with R8 and JS bytecode compile all succeed. Gradle 9.7.1 needs AGP 9 (AGP 8.x uses Gradle internal APIs removed in 9.6).Not verified: Gradle 8.x builds with these scripts (the
kotlin-androidbranch below AGP 9 is unchanged logic), iOS.Needed by the matching oss-weather PR that moves the app to Gradle 9.7.1.