react-native
react-native copied to clipboard
newArchEnabled=true not working on android
Description
I'm trying integration RN onto existing android app based on guide
after finish every steps, I did set newArchEnabled=true in gradle.properties
however it looks not working when the app access to metro bundle I can see
Running "MyAppName" with {"rootTag":11}
without the flag. fabric: true
Steps to reproduce
- create RN project
- paste existing android project under RN project
- set newArchEnabled=true
- build and run on device
React Native Version
0.74.1
Affected Platforms
Runtime - Android
Areas
Fabric - The New Renderer, Codegen
Output of npx react-native info
System:
OS: macOS 13.6
CPU: (10) arm64 Apple M1 Pro
Memory: 79.95 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.12.0
path: ~/.nvm/versions/node/v20.12.0/bin/node
Yarn:
version: 3.6.4
path: /opt/homebrew/bin/yarn
npm:
version: 10.5.0
path: ~/.nvm/versions/node/v20.12.0/bin/npm
Watchman:
version: 2024.05.06.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /Users/dylan/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK:
API Levels:
- "28"
- "32"
- "33"
- "34"
Build Tools:
- 28.0.3
- 30.0.3
- 32.0.0
- 33.0.0
- 33.0.1
- 34.0.0
System Images:
- android-33 | Google APIs ARM 64 v8a
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2023.2 AI-232.10300.40.2321.11567975
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.11
path: /Users/dylan/.jenv/shims/javac
Ruby:
version: 3.3.0
path: /Users/dylan/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.1
wanted: 0.74.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: false
Stacktrace or Logs
nothing
Reproducer
nothing
Screenshots and Videos
No response
We can't help you further without any more information. We'll need to see the code somehow of your application
We can't help you further without any more information. We'll need to see the code somehow of your application
I put repository url for reproducer @cortinico
what i did is, create react-native project, create new android to replacement android
inside of RN project
follow https://reactnative.dev/docs/integration-with-existing-apps?language=kotlin
and add below properties into gradle.properties
hermesEnabled=true
newArchEnabled=true
So your setup can't work as it is.
You're missing the MainApplication
class which is needed to initialize everything properly.
Please take a look at the official template and update your setup to match the one from the template:
https://github.com/facebook/react-native/tree/0.74-stable/packages/react-native/template/android/app/src/main/java/com/helloworld