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

app crash in release build only #22046

Closed
ProMasoud opened this issue Oct 31, 2018 · 7 comments
Closed

app crash in release build only #22046

ProMasoud opened this issue Oct 31, 2018 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ProMasoud
Copy link

Environment

Environment:
OS: Windows 10
Node: 8.12.0
Yarn: Not Found
npm: 6.4.1
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

Packages: (wanted => installed)
react: ^16.5.2 => 16.5.2
react-native: ^0.55.4 => 0.55.4

Description

I have problem with release build of react native. App successfully generated and install in device but crash while open the app.

With android studio LOGCAT I get the log of app and this is the error

018-10-31 23:46:36.803 23221-23239/? D/ReactNative: CatalystInstanceImpl.runJSBundle()
    
    --------- beginning of crash
2018-10-31 23:46:36.804 23221-23239/? E/AndroidRuntime: FATAL EXCEPTION: Thread-2
    Process: com.myter.parsandishan.parvak, PID: 23221
    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)

of course in debug build app work correctly with any problem

I searched a lot in previous issue and stackoverflow but any of them wasn't for release build.

@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.

@ingviso
Copy link

ingviso commented Nov 2, 2018

Was this resolved by updating to latest react-native release ?
Running into same issue with react-native 0.55.2

@ProMasoud
Copy link
Author

@ingviso do this steps in terminal at project root directory
1.(in project directory) mkdir android/app/src/main/assets
2.react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
this produce 2 files that fix the problem. if other files created delete them
for determines other files you can use git.
3.react-native run-android

this fix the problem for me

@ingviso
Copy link

ingviso commented Nov 2, 2018

That worked thanks @ProMasoud

@yrjkqq
Copy link

yrjkqq commented Mar 19, 2019

@ingviso do this steps in terminal at project root directory
1.(in project directory) mkdir android/app/src/main/assets
2.react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
this produce 2 files that fix the problem. if other files created delete them
for determines other files you can use git.
3.react-native run-android

this fix the problem for me

works for me. thanks

@ralexand56
Copy link

ralexand56 commented Aug 22, 2019

Wow! Been pulling my hair out over this. Why does this work? I inherited a project that doesn't actually have an index.js file so I updated your script to use index.android.js but why does my debug project run with no problem but the signed apk release build crash on startup.

Thanks again!

@sjonchhe
Copy link

sjonchhe commented Sep 3, 2019

@ingviso do this steps in terminal at project root directory
1.(in project directory) mkdir android/app/src/main/assets
2.react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
this produce 2 files that fix the problem. if other files created delete them
for determines other files you can use git.
3.react-native run-android

this fix the problem for me

Thanks a million!

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

No branches or pull requests

6 participants