Remove the AGP 9 opt-outs once react-native-test-app supports them
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Refactorisation
- Clarté
- Clairement spécifiée
- Activité
- Calme
- Stack technique
- android, kotlin, react-native
- Domaine
- build-system, mobile
Piste de recherche
Commencez par apps/test-app/android/gradle.properties et packages/host/android/build.gradle, puis examinez les fichiers Gradle Android de react-native-test-app cités ainsi que les deux blocages de migration. Vérifiez les changements du module host liés au nouveau DSL tout en préservant son comportement conditionnel pour built-in-Kotlin, et exécutez les vérifications de configuration et d’installation de l’application de test Android. C’est terminé lorsque les deux opt-outs sont supprimés et que l’application de test se configure et s’installe toujours une fois les blocages upstream résolus.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
The test app sets both AGP 9 opt-outs in apps/test-app/android/gradle.properties:
android.builtInKotlin=false
android.newDsl=false
This issue tracks removing them. Both are blocked on react-native-test-app, not on us.
Correction. An earlier revision of this issue said we were "already off the sibling flag" and running built-in Kotlin natively. That was wrong — we tried it, the Android build failed, and #372 had to put
android.builtInKotlin=falseback. Details in blocker 1.
Deadline
Per Android's DSL/API migration timeline, AGP 10.0 (estimated late 2026) removes both opt-outs, along with the legacy APIs. Once React Native pins an AGP 10 these flags stop being a choice — the build either has migrated or it doesn't configure. That is plausibly one or two React Native minors away, so this is a when, not an if.
Blocker 1: built-in Kotlin — sources added via java.srcDirs are not compiled
react-native-test-app's app module adds its version-specific sources with main.java.srcDirs += [...]. The Kotlin plugin adds those directories to the Kotlin source set; AGP's built-in Kotlin only picks up the standard ones. Building with the flag unset (react-native-test-app 5.4.8, React Native 0.88 nightly, AGP 9.2.1) fails :app:compileReleaseKotlin:
e: ComponentActivity.kt:33:9 Unresolved reference 'ComponentActivityDelegate'
e: MainActivity.kt:145:9 Unresolved reference 'testApp'
e: MainActivity.kt:225:50 Unresolved reference 'reactHost'
e: MainActivity.kt:135:17 Unresolved reference 'canUseCamera'
e: MainActivity.kt:25:45 Unresolved reference 'ComponentBottomSheetDialogFragment'
Every unresolved symbol lives in an added directory — src/reactactivitydelegate-0.75/java, src/reactapplication-0.76/java, src/reacthost-0.76/java, src/camera/java. Files under the standard src/main/java compile fine. Their useBuiltInKotlin gate avoids applying the Kotlin plugin on top of built-in Kotlin, but the module still needs that plugin to compile at all.
Likely fix upstream: add the same directories to main.kotlin.srcDirs.
Our own half is already done. react-native-node-api applies the Kotlin plugin only when built-in Kotlin is unavailable, so the published library works under either regime no matter what the harness needs. That shipped in #372 and waits on nothing.
Blocker 2: the new DSL
Both react-native-test-app modules still use the old DSL, permalinked at 5.4.8:
| Location | Old DSL |
|---|---|
android/app/build.gradle#L77 |
compileSdkVersion |
android/app/build.gradle#L88 |
kotlinOptions (gated on !useBuiltInKotlin) |
android/app/build.gradle#L95-L96 |
minSdkVersion, targetSdkVersion |
android/app/build.gradle#L161 |
lintOptions |
android/support/build.gradle#L16 |
compileSdkVersion |
android/support/build.gradle#L19-L20 |
minSdkVersion, targetSdkVersion |
packages/host/android/build.gradle is old DSL too, and this half is ours. It matters beyond our CI: it is the published library, so it has to be new-DSL clean before consumers can migrate — the same shape as the built-in Kotlin problem that file already solves.
#L52,#L69— script-styleapply plugin:instead of aplugins {}block#L101—compileSdkVersion#L109-L110—minSdkVersion,targetSdkVersion#L154—lintOptions
Ordering
The flags are coupled one way: builtInKotlin=false requires newDsl=false, because the Kotlin plugin is incompatible with the new DSL. So blocker 1 has to be resolved before blocker 2 can be — though each piece of work is independently useful, and our own module can move to the new DSL at any time.
Nothing upstream tracks either blocker yet. Whether to file it, and the paste-ready text, is #390.
Done when
Both lines are gone from apps/test-app/android/gradle.properties and the Android test app still configures and installs.
Introduced by #372. Links into this repo point at main and are accurate as of that PR merging.
- Langage dominant
- TypeScript
- Étoiles
- 191
- Forks
- 10
- Merge moyen
- 2 j 17 h
- PR mergées (30 j)
- 3
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de callstackincubator/react-native-node-api
-
Android 🤖
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
-
Sanity check of Hermes source directory via environment variable, when building Android projectsOuverteAndroid 🤖 good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
callstackincubator/react-native-node-api#163 · 1 commentaire ·
-
enhancement good first issue gyp-to-cmake
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
callstackincubator/react-native-node-api#161 · 3 commentaires · 1 réaction ·
-
enhancement Host 🏡
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Automatable good first issue
Difficulté 3/5 1-2 jours Accessibilité débutants 15/100
callstackincubator/react-native-node-api#424 · 1 commentaire ·
Toutes les issues de callstackincubator/react-native-node-api
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
external-issue to-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
diegosouzapw/OmniRoute#15401 ·
Les mainteneurs répondent en général sous 2 jours
-
Sign the pledgeOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
input-output-hk/devx-updates#163 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
code-yeongyu/oh-my-openagent#9454 ·
Les mainteneurs répondent en général sous 1 jour