Repository navigation
Android app crashes on RN 0.60.5 with Hermes enabled #26154
Copy link
Copy link
Closed
Labels
BugPlatform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Steps To Reproduce
- Build the app in the release mode with
enableHermesflag set totrue - After successful build launch the app and observe
Unfortunately, [app name] has stopped
The following error is logged out:
08-22 16:36:24.564 1467 1535 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
08-22 16:36:24.564 1467 1535 E AndroidRuntime: Process: com.myapp.react.android.beta, PID: 1467
08-22 16:36:24.564 1467 1535 E AndroidRuntime: com.facebook.react.common.JavascriptException: Cannot read property 'prototype' of undefined, js engine: hermes, stack:
08-22 16:36:24.564 1467 1535 E AndroidRuntime: anonymous@1:180603
08-22 16:36:24.564 1467 1535 E AndroidRuntime: v@1:149593
08-22 16:36:24.564 1467 1535 E AndroidRuntime: d@1:149286
08-22 16:36:24.564 1467 1535 E AndroidRuntime: o@1:148914
08-22 16:36:24.564 1467 1535 E AndroidRuntime: anonymous@1:180235
08-22 16:36:24.564 1467 1535 E AndroidRuntime: v@1:149593
08-22 16:36:24.564 1467 1535 E AndroidRuntime: d@1:149286
08-22 16:36:24.564 1467 1535 E AndroidRuntime: o@1:148914
08-22 16:36:24.564 1467 1535 E AndroidRuntime: anonymous@1:179628
08-22 16:36:24.564 1467 1535 E AndroidRuntime: v@1:149593
08-22 16:36:24.564 1467 1535 E AndroidRuntime: d@1:149286
08-22 16:36:24.564 1467 1535 E AndroidRuntime: o@1:148914
08-22 16:36:24.564 1467 1535 E AndroidRuntime: anonymous@1:155643
08-22 16:36:24.564 1467 1535 E AndroidRuntime: v@1:149593
08-22 16:36:24.564 1467 1535 E AndroidRuntime: d@1:149243
08-22 16:36:24.564 1467 1535 E AndroidRuntime: o@1:148914
08-22 16:36:24.564 1467 1535 E AndroidRuntime: global@1:148646
08-22 16:36:24.564 1467 1535 E AndroidRuntime:
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
08-22 16:36:24.564 1467 1535 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
08-22 16:36:24.566 602 2039 W ActivityManager: Force finishing activity com.myapp.react.android.beta/uk.co.myorg.myapp.ui.splash.SplashScreenActivity
08-22 16:36:24.659 602 651 I OpenGLRenderer: Initialized EGL, version 1.4
08-22 16:36:24.680 1467 1467 E WindowManager:
08-22 16:36:24.680 1467 1467 E WindowManager: android.view.WindowLeaked: Activity com.myapp.react.android.beta.MainActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{b436d8f V.E...... R....... 0,0-1200,1920} that was originally added here
08-22 16:36:24.680 1467 1467 E WindowManager: at android.view.ViewRootImpl.<init>(ViewRootImpl.java:368)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.Dialog.show(Dialog.java:319)
08-22 16:36:24.680 1467 1467 E WindowManager: at org.devio.rn.splashscreen.SplashScreen$1.run(SplashScreen.java:36)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.Activity.runOnUiThread(Activity.java:5524)
08-22 16:36:24.680 1467 1467 E WindowManager: at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:27)
08-22 16:36:24.680 1467 1467 E WindowManager: at com.myapp.react.android.beta.MainActivity.onCreate(MainActivity.java:14)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.Activity.performCreate(Activity.java:6251)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.ActivityThread.-wrap11(ActivityThread.java)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.os.Handler.dispatchMessage(Handler.java:102)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.os.Looper.loop(Looper.java:148)
08-22 16:36:24.680 1467 1467 E WindowManager: at android.app.ActivityThread.main(ActivityThread.java:5417)
08-22 16:36:24.680 1467 1467 E WindowManager: at java.lang.reflect.Method.invoke(Native Method)
08-22 16:36:24.680 1467 1467 E WindowManager: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
08-22 16:36:24.680 1467 1467 E WindowManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Although the build is successful I can see a lot of warnings being printed out:
> Task :app:bundleReleaseJsAndAssets
Loading dependency graph, done.
info Writing bundle output to:, /path-to-my-repo/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /path-to-my-repo/android/app/build/intermediates/sourcemaps/react/release/index.android.bundle.packager.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 700 asset files
info Done copying assets
/path-to-my-repo/android/app/build/generated/assets/react/release/index.android.bundle:7:113: warning: the variable "Intl" was not declared in function " 26#"
__d(function(g,r,i,a,m,e,d){"use strict";var l,u=(l=r(d[0]))&&l.__esModule?l:{default:l};if('undefined'==typeof Intl)void 0!==g?g.Intl={PluralRules:u.default}:'undefined'!=typeof window?window.Intl={PluralRules:u.default}:(void 0).Intl={PluralRules:u.default};else if(Intl.PluralRules){var t=['en','es','ru','zh'];Intl.PluralRules.supportedLocalesOf(t).length<t.length&&(Intl.PluralRules=u.default)}else Intl.PluralRules=u.default},1,[2]);
The warning: the variable "XXX" was not declared in function repeats then several times for the following variables:
IntlnavigatorDebuggerInternal__REACT_DEVTOOLS_GLOBAL_HOOK__nativeFabricUIManagersetImmediateWorkerfetchFileReaderBlobFormDataURLSearchParamsXMLHttpRequestrequestAnimationFramecancelAnimationFrameperformanceMessageChannelclearImmediateisOrientationLockedInSettingsSC_DISABLE_SPEEDY__webpack_nonce__pathFileeventResourceInUseOverconstrainedError
React Native version:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Memory: 99.21 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.10.0/bin/npm
Watchman: 4.7.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: 26, 27, 28, 29
Build Tools: 25.0.0, 26.0.2, 27.0.2, 27.0.3, 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.0 AI-171.4443003
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
react-native-generate: 0.1.0
react-native-git-upgrade: 0.2.7
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugPlatform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Activity
[-]Android app crashes on RN 0.60.2 with Hermes enabled[/-][+]Android app crashes on RN 0.60.5 with Hermes enabled[/+]brooklyn097 commentedon Sep 11, 2019
Same issue here, how to fix this please?
bareynol commentedon Oct 8, 2019
I am also experiencing the warning of
warning: the variable "XXX" was not declared in function, except the build completes successfully and the app appears to run properly, though I am concerned about what potential effects this has that I am missing.I'm on React Native 0.61.2, and I get this warning for the following variables:
"DebuggerInternal" was not declared in function "s 4#""clearTimeout" was not declared in function "componentWillUnmount 1#""setTimeout" was not declared in function "touchableHandleResponderGrant""__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in function "Cl""nativeFabricUIManager" was not declared in function " 443#""setImmediate" was not declared in function "h 4#""Worker" was not declared in function " 508#""fetch" was not declared in function " 570#""Headers" was not declared in function " 570#""Request" was not declared in function " 570#""Response" was not declared in function " 570#""FileReader" was not declared in function "p 12#""Blob" was not declared in function " 579#""FormData" was not declared in function " 579#""URLSearchParams" was not declared in function " 579#""XMLHttpRequest" was not declared in function " 586#""MessageChannel" was not declared in function " 683#""clearImmediate" was not declared in function " 762#""requestAnimationFrame" was not declared in function "value 348#""cancelAnimationFrame" was not declared in function "componentWillUnmount 3#""__g" was not declared in function " 1543#""__e" was not declared in function " 1544#""postMessage" was not declared in function "n 93#""document" was not declared in function " 1582#""PromiseRejectionEvent" was not declared in function " 1584#""clearInterval" was not declared in function "p 34#""setInterval" was not declared in function "update"592da commentedon Nov 18, 2019
Happened to me as well, Version 60.5,
Android crash when app starts,
Due
'Intl' not exist engine hermes jserror.ithustle commentedon Jan 17, 2020
+1
Ouadie commentedon Jan 18, 2020
Any update on this?
stale commentedon Apr 17, 2020
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
rohit75 commentedon Apr 23, 2020
Facing this issue, please suggest some solution
mreorhan commentedon May 12, 2020
Same issue, when I enabled hermes engine.
mreorhan commentedon May 26, 2020
Is there any update?
hasgardee commentedon Jul 22, 2020
any fix? v0.62.2 still facing issue
7 remaining items
talaikis commentedon Jan 8, 2022
+1 for 0,66,4 (hermes enabled), will try to polyfill.
kris1803 commentedon Aug 4, 2022
Same for 0.68 with hermes
izyspania commentedon Oct 6, 2022
Same here with 0.68 , app seems to be working.
React Native sync for revisions fccf3a9...f828bad
React Native sync for revisions fccf3a9...47cf4e5
React Native sync for revisions fccf3a9...3554c88
github-actions commentedon Apr 4, 2023
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
github-actions commentedon Apr 11, 2023
This issue was closed because it has been stalled for 7 days with no activity.
tahababou12 commentedon Apr 23, 2023
I am still experiencing this with React Native 0.64.4