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

Release build crashes on Android & iOS (On Launch) #18121

Closed
YogeshYo opened this issue Feb 27, 2018 · 17 comments
Closed

Release build crashes on Android & iOS (On Launch) #18121

YogeshYo opened this issue Feb 27, 2018 · 17 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: Android Android applications. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@YogeshYo
Copy link

YogeshYo commented Feb 27, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

OS:  macOS Sierra 10.13.2
Node:  8.4.0
Yarn:  1.0.2
npm:  5.6.0
Watchman:  4.9.0
Xcode:  Xcode  9 Build version 8E3004b
Android Studio: 3 AI-162.4069837

Packages: (wanted => installed)
react-native: 0.52.0 => 0.52.0
react: 16.2.0 => 16.2.0

Target Platform: iOS (10.3, Android 7.1.2

Steps to Reproduce

(Write your steps here:)

iOS & Android release build crashes on application launch, debug build works fine.
2336165327667826946

Log
02-27 21:41:13.822 8695 8754 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
02-27 21:41:13.822 8695 8754 E AndroidRuntime: Process: com.reactwork, PID: 8695
02-27 21:41:13.822 8695 8754 E AndroidRuntime: com.facebook.react.common.JavascriptException: undefined is not a function (evaluating '(void 0)()'), stack:
02-27 21:41:13.822 8695 8754 E AndroidRuntime: @531:415
02-27 21:41:13.822 8695 8754 E AndroidRuntime: c@2:837
02-27 21:41:13.822 8695 8754 E AndroidRuntime: n@2:409
02-27 21:41:13.822 8695 8754 E AndroidRuntime: t@2:262
02-27 21:41:13.822 8695 8754 E AndroidRuntime: @402:1044
02-27 21:41:13.822 8695 8754 E AndroidRuntime: c@2:837
02-27 21:41:13.822 8695 8754 E AndroidRuntime: n@2:409
02-27 21:41:13.822 8695 8754 E AndroidRuntime: t@2:262
02-27 21:41:13.822 8695 8754 E AndroidRuntime: @336:133
02-27 21:41:13.822 8695 8754 E AndroidRuntime: c@2:837
02-27 21:41:13.822 8695 8754 E AndroidRuntime: n@2:409
02-27 21:41:13.822 8695 8754 E AndroidRuntime: t@2:262
02-27 21:41:13.822 8695 8754 E AndroidRuntime: @303:161
02-27 21:41:13.822 8695 8754 E AndroidRuntime: c@2:837
02-27 21:41:13.822 8695 8754 E AndroidRuntime: n@2:409
02-27 21:41:13.822 8695 8754 E AndroidRuntime: t@2:262

Expected Behavior

The release build should not crash.

Actual Behavior

The debug build working fine.
The release build crashes on launch after displaying native splash screen.

Reproducible Demo

https://github.com/Tradesmen/CRASH/tree/master.

(Paste the link to an example project and exact instructions to reproduce the issue.)

@joshjhargreaves
Copy link
Contributor

@YogeshYo are you able to provide us a reproducible demo?

@YogeshYo
Copy link
Author

YogeshYo commented Mar 1, 2018

@joshyhargreaves, Thanks for your reply.
What demo do you need on this? Please guide. I have attached screenshot.
The crash takes place as soon as we launch application even before appearing splash screen only in the release build both iOS & Android.
I tried on another system as well but the same result.
I also tried upgrading react-native & reinstalling node modules.
What may be the reason for such type of issue i.e only in release build & Void 0?
Do you need a package.json details?

@joshjhargreaves
Copy link
Contributor

Ideally we’d have a project you’ve uploaded which exhibits this crash; maybe you can reproduce with your depdencies and a new project.

However, when I’ve seen crashes that happen on both iOS and Android at startup, it usually points to a problem that only occurs when building the jsbundle in release mode.

To test this theory, modify your JSCodeCodeLocation on Android or iOS to point to: http://localhost:8081/index.bundle?platform=ios&dev=false&minify=false and see if the stack trace is any more informative.

@YogeshYo
Copy link
Author

YogeshYo commented Mar 5, 2018

@joshyhargreaves, I tried above for android
protected String getJSMainModuleName() {
return "http://localhost:8081/index.bundle?platform=android&dev=false&minify=false";
}
but no luck. if you want I can present you the demo.

@joshjhargreaves
Copy link
Contributor

The actual point is finding the cause of the crash!

@YogeshYo
Copy link
Author

YogeshYo commented Mar 5, 2018

@joshyhargreaves, With jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.bundle?platform=ios&dev=false&minify=false"];. I am able to get tha same message as i posted earlier.
simulator screen shot - iphone 6 - 2018-03-06 at 00 14 06

@YogeshYo
Copy link
Author

YogeshYo commented Mar 6, 2018

@joshyhargreaves, anything else I can try? Release build was working fine until last week. I tried a release build with removed lib added since then but same error on release build. "App crashes after splash screen on both Android & iOS"

@joshjhargreaves
Copy link
Contributor

@yogesho, the thing I might suggest, is if you can keep your native dependencies, remove any application code that you don’t want to upload, and create a repro project, then that’s be easier for one of us to take a look.

@YogeshYo
Copy link
Author

YogeshYo commented Mar 6, 2018

@joshyhargreaves, i have shared repository details to you at joshyhargreaves@gmail.com

@YogeshYo
Copy link
Author

YogeshYo commented Mar 8, 2018

@joshyhargreaves, can you please look into this? I tried to reach you on Gmail. Thanks

@joshjhargreaves
Copy link
Contributor

joshjhargreaves commented Mar 8, 2018 via email

@YogeshYo
Copy link
Author

YogeshYo commented Mar 8, 2018

Hi @joshyhargreaves ,

I will do this still, I think if you have a chance to have at least one look then I am sure you can at least give me hint to move ahead on this. Believe me, I tried everything I can & now I am stuck.
It's already around 10 days so I am requesting you to have one look.

Thanks

@YogeshYo
Copy link
Author

YogeshYo commented Mar 8, 2018

HI @joshyhargreaves, reproducible demo added
https://github.com/Tradesmen/CRASH/tree/master.
I request you to remove "Need more information" badge.
Thanks

@joshjhargreaves joshjhargreaves added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs More Information ❔ labels Mar 8, 2018
@testshallpass
Copy link

testshallpass commented Mar 12, 2018

@YogeshYo I have similar issue and it start happening after upgrade to react-native 0.50.4. I'm told the cause could be a that a dependency violates things that became invalid in react 16.0.0.

@YogeshYo
Copy link
Author

@testshallpass, I went line by line & found two culprits for this issue (i.e only in release build).

Platform.select({
"ios": () => StatusBar.setBarStyle("light-content"),
"android": () => StatusBar.setBackgroundColor("#263238")
})();
The second was #4831 for which I got a proper message in the crash log which helped me to fix.

Still, i think for the 1st; either the issue should be rectified in debug build or at least get a proper error message in the crash log.

@react-native-bot react-native-bot added Android Ran Commands One of our bots successfully processed a command. Platform: iOS iOS applications. labels Mar 13, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@stale
Copy link

stale bot commented Jun 17, 2018

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 "For Discussion" or "Good first issue" 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 Jun 17, 2018
@stale
Copy link

stale bot commented Jul 17, 2018

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 Jul 17, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: Android Android applications. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. 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

5 participants