Skip to content

Commit 7c1abbc

Browse files
kraenhansenclaude
andcommitted
test-app: adopt built-in Kotlin on Android, opt out of the AGP 9 DSL
With React Native 0.87 the test app builds against AGP 9.2.1, where built-in Kotlin is enabled by default. Nothing in the build needs the Kotlin plugin any more: ReactAndroid dropped it upstream, react-native-test-app's modules are gated on it, and react-native-node-api now only applies it when built-in Kotlin is unavailable. So unlike the React Native app template, we do not set `android.builtInKotlin=false`. The new DSL is a different matter and stays opted out: both of react-native-test-app's Gradle modules still use the old one, and that is third-party code. AGP 10 removes this opt out, so it is tracked in #389 along with the upstream code that has to migrate first. Also pins the Gradle wrapper at 9.4.1, which react-native-test-app rewrites it to at run time for React Native >= 0.87 — pinning it ourselves keeps CI from building with a dirty working tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 9d990a5 commit 7c1abbc

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎apps/test-app/android/gradle.properties‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,16 @@ react.buildFromSource=true
5050
#ANDROID_NDK_VERSION=26.1.10909125
5151

5252
# Version of Kotlin to build against.
53-
#KOTLIN_VERSION=1.8.22
53+
#KOTLIN_VERSION=1.8.22
54+
55+
# Opt out of the new DSL that ships enabled in AGP 9, because both of
56+
# react-native-test-app's Gradle modules still use the old one. AGP 10 removes
57+
# this opt out, so it is on borrowed time — tracked in
58+
# https://github.com/callstackincubator/react-native-node-api/issues/389, which
59+
# links the upstream code that has to migrate first.
60+
#
61+
# Note that we deliberately do NOT opt out of built-in Kotlin (the flag AGP 10
62+
# also removes): React Native's own ReactAndroid no longer applies the Kotlin
63+
# plugin, and `react-native-node-api` only applies it when built-in Kotlin is
64+
# unavailable, so the whole build is built-in-Kotlin native.
65+
android.newDsl=false

‎apps/test-app/android/gradle/wrapper/gradle-wrapper.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)