Upgrade Gradle to 9.4 (Kotlin 2.3, AGP 9.1, JDK 26)#56222
Draft
leotm wants to merge 2 commits intofacebook:mainfrom
Draft
Upgrade Gradle to 9.4 (Kotlin 2.3, AGP 9.1, JDK 26)#56222leotm wants to merge 2 commits intofacebook:mainfrom
leotm wants to merge 2 commits intofacebook:mainfrom
Conversation
58dc716 to
eada3f9
Compare
|
Gradle 9.4.0 -> 9.4.1 Also agp 9.2 require at least 9.5.x so if this is not so urget it can wait until 9.5.x series became stable ( Right now it is https://github.com/gradle/gradle/releases/tag/v9.5.0-RC1 ) |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
573ff02 to
9a017c2
Compare
## Summary: Follow-up to + facebook#55453 + react-native-community/template#205 - bump Gradle wrappers 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 (RNGP) - bump RNGP Kotlin compiler API ver from KOTLIN_1_8 to KOTLIN_2_3 (RNGP) - AGP 9 DSL syntax updates - NB: AGP 9.1 removed direct prop accessors, replaced by lambdas (DSL closures) - ReactPlugin.kt - fix: arg type mismatch: actual type is File, String expected - old .asFile returns File, directories.add() needs String, use .asFile.absolutePath to convert File to String path - NB: AGP 9 replaced .srcDir with directories.add, expects String paths (not File objects) - AgpConfiguratorUtils.kt - fix: unresolved ref 'namespace', update to lambdas - fix: NoSuchMethodError for buildFeatures, 'LibraryBuildFeatures LibraryExtension.getBuildFeatures()', update to lambdas - NdkConfiguratorUtils.kt - fix: com.android.build.api.dsl. ApplicationBuildFeatures ApplicationExtension.getBuildFeatures breaking rn-tester createBundleReleaseJsAndAssets, update to lambdas - fix: com.android.build.api.dsl. ApplicationDefaultConfig ApplicationExtension.getDefaultConfig() breaking rn-tester createBundleReleaseJsAndAssets, update to lambdas - ReactAndroid/build.gradle.kts - fix: java.exclude Unresolved ref 2 script compilation errors - refactor legacy Java source exclusion to explicit filter patterns (Ant-style globs) - NB: AGP 9 AndroidSourceDirectorySet stopped extending PatternFilterable - JsonUtilsTest.kt - fix: :gradle-plugin:shared:compileTestKotlin 40 warnings as errors Unnecessary non-null assertion (!!) on a non-null receiver - assert null once at entry point of vars as done in past 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 compat - .\gradlew :gradle-plugin:react-native-gradle-plugin:compileKotlin -PenableWarningsAsErrors=true --no-daemon - .\gradlew :packages:rn-tester:android:app:createBundleReleaseJsAndAssets -PenableWarningsAsErrors=true --no-daemon - .\gradlew :packages:react-native:ReactAndroid:buildCMakeDebug[arm64-v8a][hermestooling,jsi,etc] -PenableWarningsAsErrors=true --no-daemon - .\gradlew :packages:react-native:ReactAndroid:build -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)
No longer required for Kotlin since AGP 9
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:
Follow-up to
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:
.\gradlew .\gradlew :private:react-native-fantom:buildFantomTesterlocally on 0.16.0 tarball 404