Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Remove the AGP 9 opt-outs once react-native-test-app supports them

未關閉
#389 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
45/100
Issue 類型
重構
描述清晰度
描述清楚
活躍度
冷清
技術堆疊
android, kotlin, react-native

研究方向

從 apps/test-app/android/gradle.properties 和 packages/host/android/build.gradle 開始,接著檢查所引用的 react-native-test-app Android Gradle 檔案以及兩個遷移阻礙。驗證 host 模組針對新 DSL 的變更,同時保留其針對 built-in-Kotlin 的條件行為,並執行 Android 測試應用程式的設定與安裝檢查。完成標準是移除兩個 opt-out,且在上游阻礙解決後測試應用程式仍能完成設定與安裝。

由索引模型根據 Issue 內容生成。

描述

Android 🤖

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=false back. 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-style apply plugin: instead of a plugins {} block
  • #L101compileSdkVersion
  • #L109-L110minSdkVersion, targetSdkVersion
  • #L154lintOptions

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.

主要語言
TypeScript
星號
188
分支
10
平均合併
2 天 17 小時
30 天內合併 PR
3

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

callstackincubator/react-native-node-api 的其他 Issue

查看 callstackincubator/react-native-node-api 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。