You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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)
Copy file name to clipboardExpand all lines: packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt
Copy file name to clipboardExpand all lines: packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/NdkConfiguratorUtils.kt
0 commit comments