Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native (0.60.4) Android app crashes after splash screen when Hermes is enabled #25730

Closed
chubillkelvin opened this issue Jul 19, 2019 · 43 comments
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@chubillkelvin
Copy link

chubillkelvin commented Jul 19, 2019

I have upgraded my RN app from 0.59.9 to 0.60.4 manually with the help of the guide (https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.60.4). The app works normally without a problem when Hermes is not enabled. However, once Hermes is enabled by following the steps in documentation (https://facebook.github.io/react-native/docs/hermes#docsNav), the app crashes after splash screen (splash screen can show normally, but crashes when trying to show the home (main) screen).

Below is the error in my Logcat that I believe leads to this error:

2019-07-19 12:13:01.341 30913-30950/? A/libc: /Users/willholen/intern/hermes/include/hermes/VM/HandleRootOwner.h:413: hermes::vm::PinnedHermesValue *hermes::vm::GCScope::newHandle(hermes::vm::HermesValue): assertion "getHandleCountDbg() < handlesLimit_ && "Too many handles allocated in GCScope"" failed
2019-07-19 12:13:01.342 30913-30950/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 30950 (mqt_js)

React Native version:

System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Memory: 2.80 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.13.0 - ~/.nvm/versions/node/v11.13.0/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.7.0 - ~/.nvm/versions/node/v11.13.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 25, 26, 27, 28, 29
Build Tools: 28.0.3, 29.0.0, 29.0.1
System Images: android-26 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1

Steps To Reproduce

  1. Upgrade the RN app manually from 0.59.9 to 0.60.4 by following React Native upgrade guide (https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.60.4)
  2. The Android app has been tested to make sure it runs normally (Hermes not enabled here).
  3. Update android/app/build.gradle as instructed in Documentation (https://facebook.github.io/react-native/docs/hermes#docsNav) to use Hermes.
  4. Run the Android app again after gradlew clean (as suggested in documentation above). I am using Android Emulator (Nexus 5X, API 26).
  5. Splash screen shows normally, but then the app crashes immediately after it tries to show the home (main) screen.

Describe what you expected to happen:
The Android app to work normally as if Hermes isn't enabled.

Changes made to android/app/build.gradle:

project.ext.react = [
entryFile: "index.js",
bundleCommand: "ram-bundle",
enableHermes: true, // clean and rebuild if changing
]

def enableHermes = project.ext.react.get("enableHermes", true);

@react-native-bot react-native-bot added the Platform: Android Android applications. label Jul 19, 2019
@DenitzOps
Copy link

DenitzOps commented Jul 19, 2019

Same here, after upgrade from 0.59.2 to 0.60.3, the app is installed as expected. When launched, splash appears and crash without error.
Tested on API 28 and API 29

@MehmoodArib
Copy link

I was getting similar error, then I opened Android Studio and tried installing from there, it did install but the app is basically useless, it's hanging and not responsive.

It same with every JS project.
Time wasted on configuring and updating > Time spent on actual code :(

@JerakRus
Copy link

Not workin release build, RN 0.60.4, hermess enabled, error:

* * * * * * * * * * * * * * * *
Build fingerprint: 'xiaomi/lavender/lavender:9/PKQ1.180904.001/V10.3.6.0.PFGMIXM:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 8796, tid: 8853, name: mqt_js  >>> ru.insales.mobile <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message too long: claimed length = 612
    r0  00000000  r1  00002295  r2  00000006  r3  00000008
    r4  0000225c  r5  00002295  r6  c80776ac  r7  0000010c
    r8  c8d74500  r9  c8077bfe  r10 ea343d8c  r11 00000000
    ip  ea33c3bc  sp  c8077698  lr  ea2a67f9  pc  ea29e01e

backtrace:
    #00 pc 0001d01e  /system/lib/libc.so (abort+58)
    #01 pc 0001d28f  /system/lib/libc.so (__assert2+22)
    #02 pc 00068415  /data/app/ru.insales.mobile-**********==/lib/arm/libc++_shared.so
    #03 pc 00068595  /data/app/ru.insales.mobile-**********==/lib/arm/libc++_shared.so
    #04 pc 0006fb1d  /data/app/ru.insales.mobile-***********==/lib/arm/libc++_shared.so
    #05 pc 0006facb  /data/app/ru.insales.mobile-***********==/lib/arm/libc++_shared.so (std::terminate()+70)
    #06 pc 0001199f  /data/app/ru.insales.mobile-***********==/lib/arm/libhermes.so

******** - for security, I hid my keys, but the problem is the same. Drop on the splash screen.

@JerakRus
Copy link

Has anyone found a solution? I'm still having trouble

@chubillkelvin
Copy link
Author

This problem still persists for me and I have not found any solution yet, if someone has any suggestion that you think is worth a try, please suggest here :)

@Navidhp
Copy link

Navidhp commented Jul 23, 2019

this issue related with #25754 we are using ram-bundle and inline-require in project ,Hermes does their work and we have to update the project and make the Hermes optimization
#25754 (comment)

@cpojer
Copy link
Contributor

cpojer commented Jul 23, 2019

Please disable ram-bundle when using Hermes. They are currently not compatible but also when you are using Hermes with bytecode and inline requires the RAM bundling optimizations should not be necessary any longer :)

@cpojer cpojer closed this as completed Jul 23, 2019
@JerakRus
Copy link

@cpojer
But I did not include the rum-bundle and inline-require. And I still have a problem. Why you close issue ?

@chubillkelvin
Copy link
Author

@cpojer After I have removed the usage of ram-bundle and inline-require in my project (also updated metro's config to match this), I still encounter the same problem. I think this issue should still be open.

@chubillkelvin
Copy link
Author

chubillkelvin commented Jul 24, 2019

I suspect this problem happens with FlatList components. Now that I have everything set up, I can use Hermes in my app. However, once I enter any pages with a FlatList component, the app crashes again and the same error shows:

2019-07-24 17:23:36.690 9011-9080 A/libc: /Users/willholen/intern/hermes/include/hermes/VM/HandleRootOwner.h:413: hermes::vm::PinnedHermesValue *hermes::vm::GCScope::newHandle(hermes::vm::HermesValue): assertion "getHandleCountDbg() < handlesLimit_ && "Too many handles allocated in GCScope"" failed
2019-07-24 17:23:36.690 9011-9080 A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9080 (mqt_js)

@raaannzzz
Copy link

still not working even hermes is not enabled

@tanviagarwaltravel
Copy link

Any help? I am also facing this issue.

@ParthShrivastav
Copy link

Downgrading React Native works for me.

@kbrandwijk
Copy link

The painful upgrade process to 0.60 must be the worst one so far. Fetch stops working, splash screens are not compatible with Hermes. These are not exotic edge cases, this are very common scenarios. The premature issue closing doesn't help either.

@cshung1994
Copy link

I think the worst one is 0.5x to 0.59

@kbrandwijk
Copy link

kbrandwijk commented Jul 26, 2019

I just did a 0.57.4 to 0.59.10 on another project. Completely painless, done in 10 minutes. Definitely holding off on 0.60 until the dust settles on the major blockers.

@lokendrarawat97
Copy link

do cd android && ./gradlew clean && cd ..
and build again : )

@affanhashone
Copy link

@kbrandwijk Splash Screen works when hermes is enable in debugginf mode, but crash on release build

@kbrandwijk
Copy link

Still unclear why @cpojer closed this, as this is clearly not solved.

@wmonecke
Copy link

wmonecke commented Aug 2, 2019

@cpojer Please re-open this issue ASAP.

@PavanKumar-sa
Copy link

Upgraded react native to 0.60.3 and flat list crashes if list items are more. React native <= 0.56 works fine for bigger list also.

@wmonecke
Copy link

wmonecke commented Aug 6, 2019

Should we reopen this issue in another thread since there is no response from @cpojer?

Literally upgraded from 0.59.8 to 0.60.4 to use ram-bundles WITH Hermes, to now have this issue closed. 😄

@raaannzzz
Copy link

if you are using react-native-firebase, this might help.

follow the instruction given here : https://github.com/mikehardy/rnfbdemo
so you will have boilerplate for RN 0.60

@harryt2
Copy link

harryt2 commented Aug 7, 2019

It's incomprehensible to me that this is still a problem in RN 0.60.4

I'm having anrs all over the place with hermes, not just with onesignal. Why would they release 0.60.4 without testing it. I'm glad I halted the rollout before I nuked all my users. I'm pretty sure this is the last straw for me with RN after the signal 11 disaster in May. I'm going to just build in a web view from now on.

@kbrandwijk
Copy link

Yeah this is ridiculous, sorry.

@rezaarifian
Copy link

APK file is generate using assembleRelease, but after install on device App crash.

Condition Crash

project.ext.react = [
    entryFile: "index.js",
    enableHermes: true,  // clean and rebuild if changing
]

if enableHermes: false App normal working on debug/relese mode. But size file to large. Use RN 0.57.8 => 20MB after upgrade RN 0.60.4 => 43MB

please reopen this issue still unclear

@Thebarda
Copy link

Thebarda commented Aug 9, 2019

@rezaarifian Are you using react-native-firebase ?

@PavanKumar-sa
Copy link

@rezaarifian
Yes, there is significant increase in app size due to hermes but if you are looking for playstore submission you can use "app.aab" file which is lesser than the size of "app.apk"

@fangyunlong666
Copy link

hello,every one. i am facing the same problem,and i do the follow to fix it.

  1. change the file like @RageBill said
  2. cd ./android && ./gradlew clean
  3. cd ../ && react-native run-android

@asleepace
Copy link

Same here but it just hangs without a crash on 0.60.5 with Hermes enabled, this only happens when using ./gradlew bundleRelease and not when using ./gradlew assembleRelease

@ragozin-n
Copy link

ragozin-n commented Sep 11, 2019

Same here but it just hangs without a crash on 0.60.5 with Hermes enabled, this only happens when using ./gradlew bundleRelease and not when using ./gradlew assembleRelease

+ 1

@annieneedscoffee
Copy link

I just created a version of an app I'd already written with react-native 59.5, using 60.5. Thank goodness I created a new version instead of trying to update the old one. I'm going back to the old one. On 60.5 IOS is fine but android is super slow and every time I go to a flatlist in android I just get an empty list and then the app freezes. I know the data is coming in because I'm displaying the number of entries found in the header but the list just stays empty. No error message in the emulator or terminal either. When I hit RR to reload then I get "unexpected end of script no stack". I tried cleaning gradle but still no luck. I think I'll stick with 59 for now.

@xjq7
Copy link

xjq7 commented Sep 24, 2019

I successfully upgraded from 0.59.9 to 0.60.5. At the beginning, I also modified the build.gradle file in the old project, but it was always invalid. Later, I created a new project with 0.60.5 and overwrite the build.gradle file into my old project, modify the dependency configuration, change enableHermes to true,

project.ext.react = [
    entryFile: "index.js",
    enableHermes: true,  // clean and rebuild if changing
]

then recompile, the app does not crash.If your project hasn't been upgraded for a long time, other dependencies have to be upgraded, because a lot of things have been discarded, and I have run into a listview that has been deprecated,Now I have successfully used 0.60.5, configured apk volume compression, my app has been reduced from 33m to 12m,I hope I can help you

@LydGol90
Copy link

LydGol90 commented Oct 1, 2019

@asleepace I am on RN version 0.61.1 when I enable Hermes it works fine for assembleRelease but hangs on the splash screen for bundleRelease. Have you had any luck?

Have realised that this is actually my issue: #26400. (My splash screen is just my background screen so looked like it was hanging). Might be a similar thing for you guys.

@longnk-1447
Copy link

This problem has been 3 months and there is no any solution, except set enableHermes: false?

@wmonecke
Copy link

wmonecke commented Oct 4, 2019

I had this issue. The only way to enable Hermes is by disabling RAM-bundles.

@longnk-1447
Copy link

I had this issue. The only way to enable Hermes is by disabling RAM-bundles.

@wmonecke wm

How disable RAM-bundles? please take a snapshot

@IamMasterWayne
Copy link

"couldn't find DSO to load: libhermes.so "
React Native Version: 0.61.2
enableHermes: false
Still facing this issue.

@d4niells
Copy link

d4niells commented Jan 2, 2020

Hello guys !

For me, it turned out it was a problem of SoLoader, which was fixed in 0.8.0. React Native 0.61.1 doesn't use this version yet, so the solution was to set it up manually by adding the following to app/build.gradle:

configurations.all {
     resolutionStrategy {
       force "com.facebook.soloader:soloader:0.8.0"
     }
}

@sarykemmoun
Copy link

I'm facing the same issue but with enableHermes: false.
forcing soLoader didn't help too.
Any solution? thanks.

@truecodex
Copy link

cd android
android>./gradlew clean
android>./gradlew cleanBuildCache
android>cd..
npx react-native run-android

@franck-nadeau
Copy link

I am getting this issue with version 0.62.2, without ram-bundle. Is there any development to get this to work?

@lucashsilva
Copy link

I have the same problem

@facebook facebook locked as resolved and limited conversation to collaborators Oct 7, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests