RNTester Android instacrash on release mode
See original GitHub issueDescription
While working on https://github.com/facebook/react-native/pull/33057 I noticed that RNTester Android release builds where instacrashing on release mode, at first I thought this had something to do with the AGP upgrade but even after switching to the main branch and cleaning cache the issue persisted.
I tested building the app through Android studio and by manually running
./gradlew :ReactAndroid:installArchives
./gradlew :packages:rn-tester:android:app:installHermesRelease
Both resulted in the same problem.
From the logs this seems to be related to the androidx.appcompat:appcompat
version we using, but I still haven’t tried upgrading it.
Version
0.68.0
Output of npx react-native info
System: OS: macOS 12.0.1 CPU: (8) arm64 Apple M1 Memory: 109.39 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.10.0 - ~/.volta/tools/image/node/16.10.0/bin/node Yarn: 1.22.11 - ~/.volta/tools/image/yarn/1.22.11/bin/yarn npm: 7.24.0 - ~/.volta/tools/image/node/16.10.0/bin/npm Watchman: 2021.09.27.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 13.0.1 - /usr/bin/javac npmPackages: @react-native-community/cli: ^7.0.1 => 7.0.1 react: 17.0.2 => 17.0.2 react-native: Not Found react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
- Open react-native repo on Android Studio
- Select
hermesRelease
as the Active Build Variant - Build and install the app
Snack, code example, screenshot, or link to a repository
Full log here https://gist.github.com/gabrieldonadel/d98b8d504aab192fa4163443c584cc94
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
That’s concerning. Thanks for spotting this.
What I believe is happening is: RN Tester is built without
react.gradle
but usingreact-native-gradle-plugin
(which is going to replacereact.gradle
). It seems like the logic to clean-up the.so
files inside the plugin is failing to removelibjsc.so
from the plugin:https://github.com/facebook/react-native/blob/669cd0257cfa6a8a1d5c8d6c741786b1abd62b41/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt#L215-L251
We should look into what’s the content of the APK for the 4 build variants (debug/release/hermes/jsc) and verify that the included
.so
files are correct.When you create a new react-native project, the issue is there, RNTester or not. I said I am “watching” this issue.