question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RNTester Android instacrash on release mode

See original GitHub issue

Description

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.

https://user-images.githubusercontent.com/11707729/152910820-b097ce6a-8ed4-4c63-b973-211232906034.mov

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

  1. Open react-native repo on Android Studio
  2. Select hermesRelease as the Active Build Variant
  3. Build and install the app

Snack, code example, screenshot, or link to a repository

image

Full log here https://gist.github.com/gabrieldonadel/d98b8d504aab192fa4163443c584cc94

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
cortinicocommented, Feb 8, 2022

That’s concerning. Thanks for spotting this.

Seems to be complaining about not finding libjscexecutor.so although I’m running a Hermes build

What I believe is happening is: RN Tester is built without react.gradle but using react-native-gradle-plugin (which is going to replace react.gradle). It seems like the logic to clean-up the .so files inside the plugin is failing to remove libjsc.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.

1reaction
peterchibunnacommented, Jun 3, 2022

with a new project on Apple M1

What do you mean “with a new project”? The issue is about RN Tester

When you create a new react-native project, the issue is there, RNTester or not. I said I am “watching” this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing React-Native android release build - wesionaryTEAM
Android release build crashes on launch but works fine in development mode. After months of research and development, your app is finally ready...
Read more >
RNTester - web-public / react-native - GitLab
These build the app in Release mode, so the production code is bundled and included in the built app. When developing E2E tests,...
Read more >
React native application getting crash in release mode
I am developing react-native application in which I also integrated ChocoPy in native android and using through react native bridge; ...
Read more >
How to Test a Release - React Native
Delete RNTester and RNTestProject from your Android emulator and iOS simulator if leftover from previous test. · Remove any temporary files from ...
Read more >
React Native Weekly - W27 2021 - Andrei Calazans
Fix CMD + OPT + R with Bridgeless mode only [iOS] ... as an opt-in mechanism to allow native Android Views to be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found