Skip to content

Commit ff3c9f1

Browse files
greclaude
andcommitted
Fix Android release APK crash: enable new architecture for RN 0.84
The release APK was crashing with "TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found" because newArchEnabled was set to false while MainApplication.kt uses bridgeless/new-arch APIs (loadReactNative, getDefaultReactHost). RN 0.84 requires new arch enabled for core TurboModules like PlatformConstants to be registered. - Enable newArchEnabled=true in gradle.properties (default for RN 0.84) - Pass -PnewArchEnabled=false only for Detox Android builds which need old arch Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b098777 commit ff3c9f1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

example/.detoxrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module.exports = {
1919
'android.debug': {
2020
type: 'android.apk',
2121
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
22-
build: 'cd android && ./gradlew assembleDebug assembleAndroidTest',
22+
build:
23+
'cd android && ./gradlew assembleDebug assembleAndroidTest -PnewArchEnabled=false',
2324
testBinaryPath:
2425
'android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk',
2526
reversePorts: [8081],

example/android/gradle.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3232
# your application. You should enable this flag either if you want
3333
# to write custom TurboModules/Fabric components OR use libraries that
3434
# are providing them.
35-
# Temporarily disabled for Detox E2E testing compatibility
36-
newArchEnabled=false
35+
newArchEnabled=true
3736

3837
# Use this property to enable or disable the Hermes JS engine.
3938
# If set to false, you will be using JSC instead.

0 commit comments

Comments
 (0)