Skip to content

Bump Gradle to 9.3.1#205

Merged
cipolleschi merged 1 commit intomainfrom
nc/gradle-9.3
Feb 16, 2026
Merged

Bump Gradle to 9.3.1#205
cipolleschi merged 1 commit intomainfrom
nc/gradle-9.3

Conversation

@cortinico
Copy link
Copy Markdown
Member

@cortinico cortinico requested a review from cipolleschi February 6, 2026 17:07
@cipolleschi cipolleschi merged commit da022b8 into main Feb 16, 2026
1 check passed
@cipolleschi cipolleschi deleted the nc/gradle-9.3 branch February 16, 2026 14:30
leotm added a commit to leotm/react-native-1 that referenced this pull request Mar 26, 2026
## Summary:

Follow-up to
+ facebook#55453
+ react-native-community/template#205

- bump Gradle wrapper from 9.3.1 to 9.4.0 (root, RNGP, helloworld)
- bump RNGP: AGP from 8.12.0 to 9.1.0, Kotlin from 2.1.20 to 2.3.0
- bump RNGP Kotlin compiler API ver from KOTLIN_1_8 to KOTLIN_2_3
- fix CI build_android and build_fantom_runner compilation errors

Then follow-up react-native-community/template gradlew and kotlinVersion updates

## Changelog:

[ANDROID] [CHANGED] - Gradle to 9.4.0, Kotlin 2.3.0, AGP 9.1.0

## Test Plan:

- leotm/react-native-template-new-architecture#1933
leotm added a commit to leotm/react-native-1 that referenced this pull request Mar 31, 2026
## Summary:

Follow-up to
+ facebook#55453
+ react-native-community/template#205

- bump Gradle wrapper from 9.3.1 to 9.4.0 (root, RNGP, helloworld)
- bump RNGP: AGP from 8.12.0 to 9.1.0, Kotlin from 2.1.20 to 2.3.0
- bump RNGP Kotlin compiler API ver from KOTLIN_1_8 to KOTLIN_2_3
- AGP 9.1 DSL syntax updates
  - update all build.gradle.kts files to use AGP 9.1 DSL
  - AgpConfiguratorUtils.kt
    - change `buildFeatures` and `defaultConfig` from direct property assignment to lambda syntax (`ext.buildFeatures { ... }` instead of `ext.buildFeatures`)
    - change `defaultConfig.buildConfigField()` and `defaultConfig.resValue()` to use lambda syntax (`ext.defaultConfig { ... }`)
    - NB: AGP 9.1 removed direct property accessors for these DSL blocks
  - NdkConfiguratorUtils.kt
    - remove deprecated prefab usage
    - replace direct `cmake.arguments` manipulation with `apply` block syntax
    - remove manual CMake argument additions (PROJECT_BUILD_DIR, PROJECT_ROOT_DIR, REACT_ANDROID_DIR, ANDROID_STL, ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES)
    - NB: AGP 9.1 changed externalNativeBuild.cmake to use apply block; arguments property may not exist in AGP 9.1
- ReactAndroid/build.gradle.kts
  - remove `java.exclude()` calls for processing and module processing packages
  - NB: causing AGP 9.1 compilation errors
- rn-tester/build.gradle.kts
  - change from `afterEvaluate` block to `tasks.withType<>().configureEach`
  - update task deps to use `configureEach` instead of `getByName()`
  - NB: more reliable task config w AGP 9.1

Then follow-up react-native-community/template gradlew and kotlinVersion updates

## Changelog:

[ANDROID] [CHANGED] - Gradle to 9.4.0, Kotlin 2.3.0 and AGP 9.1.0

## Test Plan:

- leotm/react-native-template-new-architecture#1933
- build_android locally with prebuilt hermes-android artifacts
  - JDK 26 sec incompat, JDK 17 ok, prebuilt stable com.facebook.hermes:hermes-android:0.16.0 artifact
  - useHermesStable=true, useHermesNightly=false, hermesV1Enabled=false, .hermesversion, version.properties, skip buildCodegenCLI
  - --dry-run -PreactNativeArchitectures=arm64-v8a
- build_phantom_runner locally requires private:react-native-fantom and compiling hermes from source w debug flags (SLOW)
leotm added a commit to leotm/react-native-1 that referenced this pull request Mar 31, 2026
## Summary:

Follow-up to
+ facebook#55453
+ react-native-community/template#205

- bump Gradle wrapper from 9.3.1 to 9.4.0 (root, RNGP, helloworld)
- bump RNGP: AGP from 8.12.0 to 9.1.0, Kotlin from 2.1.20 to 2.3.0
- bump RNGP Kotlin compiler API ver from KOTLIN_1_8 to KOTLIN_2_3
- AGP 9.1 DSL syntax updates
  - ReactPlugin.kt: fix 'Argument type mismatch: actual type is File, but String was expected'
    - AGP 9.1 changed java.srcDir() to use directories.add(), expects String paths (not File objects)
    - old .asFile returns File, directories.add() needs a String - use .asFile.absolutePath to convert File to String path
  - AgpConfiguratorUtils.kt
    - fix: unresolved reference 'namespace'
      - AGP 9.1 removed direct namespace prop from LibraryAndroidComponentsExtension
      - use components.finalizeDsl { dsl -> dsl.namespace = ... }
    - fix: NoSuchMethodError for buildFeatures, 'LibraryBuildFeatures LibraryExtension.getBuildFeatures()'
      - AGP 9.1 removed direct property accessors and changed buildFeatures API to use lambda syntax
      - change `buildFeatures` and `defaultConfig` from direct property assignment to lambda syntax (`ext.buildFeatures { ... }` instead of `ext.buildFeatures`)
      - change `defaultConfig.buildConfigField()` and `defaultConfig.resValue()` to use lambda syntax (`ext.defaultConfig { ... }`)
  - NdkConfiguratorUtils.kt
    - remove deprecated `ext.buildFeatures.prefab = true` (AGP 9.1+ libs declare prefab config directly in their build.gradle)
    - replace direct `cmake.arguments` manipulation with `ext.defaultConfig { }` lambda syntax
    - keep manual CMake argument additions (PROJECT_BUILD_DIR, PROJECT_ROOT_DIR, REACT_ANDROID_DIR, REACT_COMMON_DIR, ANDROID_STL, ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES)
    - NB: AGP 9.1 changed DSL access - `defaultConfig` is now a lambda method, not a direct property
- ReactAndroid/build.gradle.kts
  - remove `java.exclude()` calls for processing and module processing packages
  - NB: causing AGP 9.1 compilation errors
- rn-tester/build.gradle.kts
  - change from `afterEvaluate` block to `tasks.withType<>().configureEach`
  - update task deps to use `configureEach` instead of `getByName()`
  - NB: more reliable task config w AGP 9.1

Then follow-up react-native-community/template gradlew and kotlinVersion updates

## Changelog:

[ANDROID] [CHANGED] - Gradle to 9.4.0, Kotlin 2.3.0 and AGP 9.1.0

## Test Plan:

- leotm/react-native-template-new-architecture#1933
- build_android locally with prebuilt hermes-android mvnrepository.com/artifact/com.facebook.hermes/hermes-android/0.16.0
  - JDK 26 sec incompat, JDK 17 ok, prebuilt stable com.facebook.hermes:hermes-android:0.16.0 artifact
  - useHermesStable=true, useHermesNightly=false, hermesV1Enabled=false, .hermesversion, version.properties, skip buildCodegenCLI
  - --dry-run -PreactNativeArchitectures=arm64-v8a
- build_phantom_runner locally requires private:react-native-fantom and compiling hermes from source w debug flags (SLOW)
leotm added a commit to leotm/react-native-1 that referenced this pull request Mar 31, 2026
## Summary:

Follow-up to
+ facebook#55453
+ react-native-community/template#205

- bump Gradle wrapper from 9.3.1 to 9.4.0 (root, RNGP, helloworld)
- bump RNGP: AGP from 8.12.0 to 9.1.0, Kotlin from 2.1.20 to 2.3.0
- bump RNGP Kotlin compiler API ver from KOTLIN_1_8 to KOTLIN_2_3
- AGP 9.1 DSL syntax updates
  - ReactPlugin.kt
  - fix: 'Argument type mismatch: actual type is File, but String was expected'
    - AGP 9.1 changed java.srcDir() to use directories.add(), expects String paths (not File objects)
    - old .asFile returns File, directories.add() needs a String - use .asFile.absolutePath to convert File to String path
  - AgpConfiguratorUtils.kt
    - fix: unresolved reference 'namespace'
      - AGP 9.1 removed direct namespace prop from LibraryAndroidComponentsExtension
      - use components.finalizeDsl { dsl -> dsl.namespace = ... }
    - fix: NoSuchMethodError for buildFeatures, 'LibraryBuildFeatures LibraryExtension.getBuildFeatures()'
      - AGP 9.1 removed direct property accessors and changed buildFeatures API to use lambda syntax
      - change `buildFeatures` and `defaultConfig` from direct property assignment to lambda syntax (`ext.buildFeatures { ... }` instead of `ext.buildFeatures`)
      - change `defaultConfig.buildConfigField()` and `defaultConfig.resValue()` to use lambda syntax (`ext.defaultConfig { ... }`)
  - NdkConfiguratorUtils.kt
    - remove deprecated `ext.buildFeatures.prefab = true` (AGP 9.1+ libs declare prefab config directly in their build.gradle)
    - replace direct `cmake.arguments` manipulation with `ext.defaultConfig { }` lambda syntax
    - keep manual CMake argument additions (PROJECT_BUILD_DIR, PROJECT_ROOT_DIR, REACT_ANDROID_DIR, REACT_COMMON_DIR, ANDROID_STL, ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES)
    - NB: AGP 9.1 changed DSL access - `defaultConfig` is now a lambda method, not a direct property
- ReactAndroid/build.gradle.kts
  - remove `java.exclude()` calls for processing and module processing packages causing AGP 9.1 compilation errors
- rn-tester/build.gradle.kts
  - change from `afterEvaluate` block to `tasks.withType<>().configureEach`
  - update task deps to use `configureEach` instead of `getByName()`
  - NB: more reliable task config w AGP 9.1
- JsonUtilsTest.kt
  - fix :gradle-plugin:shared:compileTestKotlin warnings, unnecessary non-null assertion (!!) on a non-null receiver of type '...'
  - causing :packages:rn-tester:android:app:benchmark:stripHermesBenchmarkDebugSymbols to fail then configureCMakeDebug

Then follow-up react-native-community/template gradlew and kotlinVersion updates

## Changelog:

[ANDROID] [CHANGED] - Gradle to 9.4.0, Kotlin 2.3.0 and AGP 9.1.0

## Test Plan:

- leotm/react-native-template-new-architecture#1933
- .github/actions/build-android/action.yml locally with prebuilt hermes-android mvnrepository.com/artifact/com.facebook.hermes/hermes-android/0.16.0
  - JDK 26 sec incompat, JDK 17 ok, prebuilt stable com.facebook.hermes:hermes-android:0.16.0 artifact
  - useHermesStable=true, useHermesNightly=false, hermesV1Enabled=false, .hermesversion, version.properties, skip buildCodegenCLI
  - --dry-run -PreactNativeArchitectures=arm64-v8a -PenableWarningsAsErrors=true
- .github\actions\build-fantom-runner\action.yml locally requires private:react-native-fantom and compiling hermes from source w debug flags (SLOW)
leotm added a commit to leotm/react-native-1 that referenced this pull request Apr 7, 2026
## Summary:

Follow-up to
+ facebook#55453
+ react-native-community/template#205

- bump Gradle wrapper from 9.3.1 to 9.4.0 (root, RNGP, helloworld)
- bump RNGP: AGP from 8.12.0 to 9.1.0, Kotlin from 2.1.20 to 2.3.0
- bump RNGP Kotlin compiler API ver from KOTLIN_1_8 to KOTLIN_2_3
- AGP 9.1 DSL syntax updates
  - NB: AGP 9.1 removed direct prop accessors, replaced by lambda syntax
  - ReactPlugin.kt
    - fix: 'Argument type mismatch: actual type is File, but String was expected'
    - NB: AGP 9.1 replaced java.srcDir() with directories.add(), expects String paths (not File objects)
    - old .asFile returns File, directories.add() needs String, use .asFile.absolutePath to convert File to String path
  - AgpConfiguratorUtils.kt
    - fix: unresolved reference 'namespace', update to lambda syntax
    - fix: NoSuchMethodError for buildFeatures, 'LibraryBuildFeatures LibraryExtension.getBuildFeatures()', update to lambda syntax
  - NdkConfiguratorUtils.kt, update to lambda syntax
  - ReactAndroid/build.gradle.kts
    - update deprecated `java.exclude()` calls behind `filter`
    - NB: AGP 9.1 deprecated AndroidSourceDirectorySet .exclude(string)

Then follow-up react-native-community/template gradlew and kotlinVersion updates
- e.g. leotm/react-native-template-new-architecture#1933

## Changelog:

[ANDROID] [CHANGED] - Gradle to 9.4.0, Kotlin 2.3.0 and AGP 9.1.0 support

## Test Plan:

+ template: leotm/react-native-template-new-architecture#1933
- locally (windows 11, CMake: 3.30.5, 4.3.1, JDK 17, JDK 26 security incompatible)
- .github/actions/build-android/action.yml with prebuilt stable com.facebook.hermes:hermes-android:0.16.0 artifact from mvnrepository.com/artifact/com.facebook.hermes/hermes-android/0.16.0
- useHermesStable=true, useHermesNightly=false, hermesV1Enabled=false, .hermesversion, version.properties
- set: ANDROID_SDK_ROOT, JAVA_HOME, NODE_HOME (prepend all to PATH)
- .\gradlew :packages:react-native:ReactAndroid:tasks
- .\gradlew :packages:react-native:ReactAndroid:build --dry-run
- .\gradlew :packages:react-native:ReactAndroid:buildCodegenCLI -PreactNativeArchitectures=arm64-v8a PenableWarningsAsErrors=true --no-daemon
  - fix buildCodegenCLI locally for Windows Git Bash
- .\gradlew :gradle-plugin:react-native-gradle-plugin:compileKotlin --no-daemon -PenableWarningsAsErrors=true --no-daemon
- .\gradlew :packages:react-native:ReactAndroid:build -PreactNativeArchitectures=arm64-v8a -PreactNativeArchitectures=arm64-v8a -PenableWarningsAsErrors=true --no-daemon
- .github\actions\build-fantom-runner\action.yml locally requires private:react-native-fantom and compiling hermes from source w debug flags (SLOW af)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants