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.

Android and iOS app crash at startup in production build

See original GitHub issue

Environment

React Native Environment Info: System: OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver) CPU: x64 Intel® Core™ i3-4150 CPU @ 3.50GHz Memory: 399.68 MB / 15.54 GB Shell: 4.4.19 - /bin/bash Binaries: Node: 8.10.0 - /usr/bin/node Yarn: 1.8.0 - /home/linuxbrew/.linuxbrew/bin/yarn npm: 5.10.0 - /home/linuxbrew/.linuxbrew/bin/npm Watchman: 4.9.0 - /home/linuxbrew/.linuxbrew/bin/watchman SDKs: Android SDK: Build Tools: 19.0.1, 19.1.0, 20.0.0, 21.1.2, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.0, 28.0.1, 28.0.2 API Levels: 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28 npmPackages: react: 16.4.1 => 16.4.1 react-native: 0.57.0 => 0.57.0 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 2.0.1 react-native-scripts: 1.14.1

Description

Android and Ios app crash at startup in production build

here is a crash log

     --------- beginning of crash
2018-10-13 09:45:01.052 4989-5013/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.elamusic.android, PID: 4989
    com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'r.default'), stack:
    b@396:1621
    <unknown>@404:2778
    c@2:822
    i@2:464
    t@2:324
    <unknown>@403:108
    c@2:822
    i@2:464
    t@2:324
    <unknown>@338:187
    c@2:822
    i@2:464
    t@2:324
    <unknown>@306:174
    c@2:822
    i@2:464
    t@2:324
    <unknown>@12:77
    c@2:822
    i@2:394
    t@2:324
    global code@798:8
    
        at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
        at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:164)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
2018-10-13 09:45:01.121 1406-1406/? E/EGL_emulation: tid 1406: eglCreateSyncKHR(1962): error 0x3004 (EGL_BAD_ATTRIBUTE)
2018-10-13 09:45:01.134 4989-5012/? E/ReactNativeJS: Module AppRegistry is not a registered callable module (calling unmountApplicationComponentAtRootTag)
2018-10-13 09:45:01.168 4989-4989/? E/WindowManager: android.view.WindowLeaked: Activity com.elamusic.android.MainActivity has leaked window DecorView@e75656b[] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:485)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
        at android.app.Dialog.show(Dialog.java:330)
        at org.devio.rn.splashscreen.SplashScreen$1.run(SplashScreen.java:36)
        at android.app.Activity.runOnUiThread(Activity.java:6184)
        at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:27)
        at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:49)
        at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:56)
        at com.elamusic.android.MainActivity.onCreate(MainActivity.java:19)
        at android.app.Activity.performCreate(Activity.java:7009)
        at android.app.Activity.performCreate(Activity.java:7000)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Following are the dependencies in package.json file

"dependencies": {
    "axios": "^0.18.0",
    "lodash.debounce": "^4.0.8",
    "moment": "^2.22.2",
    "prop-types": "^15.6.2",
    "react": "16.4.1",
    "react-native": "0.57.0",
    "react-native-bottomsheet": "^1.9.0",
    "react-native-collapsible": "^0.13.0",
    "react-native-color-palette": "^2.0.1",
    "react-native-device-info": "^0.22.5",
    "react-native-htmlview": "^0.13.0",
    "react-native-image-crop-picker": "^0.21.1",
    "react-native-keyboard-aware-scroll-view": "^0.7.2",
    "react-native-linear-gradient": "^2.4.2",
    "react-native-loading-spinner-overlay": "^0.5.2",
    "react-native-localization": "^2.0.1",
    "react-native-modal-popover": "0.0.10",
    "react-native-modalbox": "^1.6.0",
    "react-native-music-control": "^0.7.3",
    "react-native-palette-full": "^1.0.6",
    "react-native-parallax-scroll-view": "^0.21.3",
    "react-native-permissions": "^1.1.1",
    "react-native-slider": "^0.11.0",
    "react-native-snackbar": "^0.5.1",
    "react-native-splash-screen": "^3.1.1",
    "react-native-vector-icons": "^5.0.0",
    "react-native-video": "^3.2.1",
    "react-navigation": "^1.0.0-beta.27",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-persist": "^5.10.0",
    "validate.js": "^0.12.0"
  }

Steps to reproduce

For iOS:

  1. Open Xcode and open the project.
  2. Setup release configurations.
  3. Connect a device, and click on run to deploy into device.

For Android:

  1. Setup release configurations.
  2. Open the Terminal and run: react-native run-android --variant=release.
  3. After the build is successful, the app is deployed to the connected device

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

3reactions
llitfkitfkcommented, Jan 4, 2019
    "react": "16.3.1",
    "react-native": "0.55.4",

‘com.android.tools.build:gradle:3.2.1’ app crashed at startup

2019-01-04 17:01:26.717 26904-26919/? E/AndroidRuntime: FATAL EXCEPTION: Thread-2
    Process: com.wifigo, PID: 26904
    java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.
        at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
        at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:216)
        at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:31)
        at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:234)
        at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1114)
        at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:113)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:911)
        at java.lang.Thread.run(Thread.java:764)

working normal after downgrade 3.2.1 to ‘com.android.tools.build:gradle:3.1.4’

0reactions
stale[bot]commented, Oct 17, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter app crashes for iOS build on startup - Stack Overflow
Run flutter clean · Navigate to the ios folder then delete the pods folder. · From your terminal command cd ios , then...
Read more >
How to Fix Crashing Apps on an iPhone or Android?
Sometimes app-crashing is not caused by your phone, but rather the app itself. An internal error, or bug, may have brought the app...
Read more >
App crashing immediately on start up after upgrading to iOS12.
Running fine in simulator but crashes in device. No crash logs recorded. In line error shown after launching the app Thread 1: EXC_BAD_ACCESS...
Read more >
app crash on startup only in release build - Unity Forum
My app crashed on both iOS/Android platforms. The weird thing is it works normally on the development version. The only difference between ...
Read more >
EAS build app crashes just on production but works fine when ...
But when I try to test with a production build, in an iOS simulator, it crashes. I tried sending it to App Store...
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