Visitar URL original
build: AGP 9.4.1 and Gradle 9.6.0 by edusperoni · Pull Request #2052 · NativeScript/android · GitHub
Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
build: Gradle 9.6.0 wrappers and AGP 9.4.1
Android Studio now builds with AGP 9.4, whose minimum (and default) Gradle
is 9.6.0, and apps pick up these wrapper and plugin versions from the
packaged project template.

- test-app and root wrappers move to Gradle 9.6.0 (scripts and wrapper
  jar regenerated by the wrapper task).
- NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION -> 9.4.1 and the default build
  tools -> 36.0.0, the minimum AGP 9.4 accepts. compileSdk stays at 35
  since it decides which APIs the metadata generator exposes to apps.
- The com.android.tools:r8 buildscript pin (and NS_DEFAULT_R8_VERSION /
  -Pr8Version) is dropped: it only existed because the R8 bundled with
  AGP 8.13 could not read Kotlin 2.4 metadata, and AGP 9.4 bundles a
  newer R8.
- The explicit org.apache.groovy:groovy-all classpath entry dates from
  the Gradle 7 migration; Gradle 9 ships Groovy 4 itself.
- BuildToolTask becomes abstract: Gradle 9 turned JavaExec's injected
  services into abstract getters, so a concrete subclass no longer
  compiles.

The app module still applies kotlin-android, which AGP 9 rejects; that is
addressed in the following commit.
  • Loading branch information
edusperoni committed Sep 22, 2026
commit 9a5d4dd8534544e919e21dd01a133a04eac4f902
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 7 additions & 11 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 12 additions & 24 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-app/app/gradle-helpers/BuildToolTask.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import static org.gradle.internal.logging.text.StyledTextOutput.Style

class BuildToolTask extends JavaExec {
abstract class BuildToolTask extends JavaExec {
void setOutputs(def logger) {
def logFile = new File("$workingDir/${name}.log")
if(logFile.exists()) {
Expand Down
4 changes: 0 additions & 4 deletions test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,16 @@ version of the {N} CLI install a previous version of the runtime package - 'tns

def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "${ns_default_kotlin_version}" }
def computeBuildToolsVersion = { -> project.hasProperty("androidBuildToolsVersion") ? androidBuildToolsVersion : "${NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION}" }
def computeR8Version = { -> project.hasProperty("r8Version") ? r8Version : "${NS_DEFAULT_R8_VERSION}" }
def kotlinVersion = computeKotlinVersion()
def androidBuildToolsVersion = computeBuildToolsVersion()
def r8Version = computeR8Version()

repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:$androidBuildToolsVersion"
classpath "com.android.tools:r8:$r8Version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.apache.groovy:groovy-all:4.0.21"
}
}

Expand Down
6 changes: 2 additions & 4 deletions test-app/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ android.enableJetifier=true
android.useAndroidX=true

# Default versions used throughout the gradle configurations
NS_DEFAULT_BUILD_TOOLS_VERSION=35.0.0
NS_DEFAULT_BUILD_TOOLS_VERSION=36.0.0
NS_DEFAULT_COMPILE_SDK_VERSION=35
NS_DEFAULT_MIN_SDK_VERSION=21
NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION=8.13.2
# R8 8.x cannot read Kotlin 2.4 metadata (needs 9.1.29+), so the AGP-bundled R8 is overridden.
NS_DEFAULT_R8_VERSION=9.1.43
NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION=9.4.1

ns_default_androidx_appcompat_version = 1.7.0
ns_default_androidx_exifinterface_version = 1.3.7
Expand Down
Binary file modified test-app/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions test-app/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Feb 11 10:56:28 AST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
41 changes: 26 additions & 15 deletions test-app/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 15 additions & 12 deletions test-app/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.