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

Android and iOS app crash at startup in production build #21765

Closed
rutvikwebmobtech opened this issue Oct 13, 2018 · 7 comments
Closed

Android and iOS app crash at startup in production build #21765

rutvikwebmobtech opened this issue Oct 13, 2018 · 7 comments
Labels
Bug Platform: Android Android applications. Platform: iOS iOS applications. Platform: Linux Building on Linux. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@rutvikwebmobtech
Copy link

rutvikwebmobtech commented Oct 13, 2018

Environment

React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: x64 Intel(R) Core(TM) 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
@react-native-bot react-native-bot added Platform: iOS iOS applications. Platform: Android Android applications. Platform: Linux Building on Linux. labels Oct 13, 2018
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@rutvikwebmobtech
Copy link
Author

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

Same issue after upgrading from v0.56 to v0.57

@llitfkitfk
Copy link

llitfkitfk commented 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'

@helielson
Copy link

helielson commented Jan 23, 2019

@llitfkitfk I got the same error.
The device logs the same exception here
Works on iOS

@Hongnin
Copy link

Hongnin commented Jul 12, 2019

I got the same error,the same logs.
Works on android.
react-native : 0.60
react:16.8.6

@stale
Copy link

stale bot commented Oct 10, 2019

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.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 10, 2019
@stale
Copy link

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.

@stale stale bot closed this as completed Oct 17, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Oct 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Platform: iOS iOS applications. Platform: Linux Building on Linux. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

6 participants