Release build crashes on iOS and Android. Fatal Exeption.
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: macOS Sierra 10.12.6 Node: 8.4.0 Yarn: Not Found npm: 5.4.1 Watchman: 4.9.0 Xcode: Xcode 8.3.3 Build version 8E3004b Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed) react: 16.0.0-beta.5 => 16.0.0-beta.5 react-native: ^0.49.3 => 0.49.3
Target Platform: iOS (8.0) Android (26)
Steps to Reproduce
- For iOS, open xcode and open the project.
- Setup release configurations.
- Connect a device, and click on run to deploy into device.
- An exception occurs with reason as follows:
'Unhandled JS Exception: undefined is not an object (evaluating 's.View.prop..., stack:
<unknown>@663:2841
i@2:553
<unknown>@661:243
i@2:553
<unknown>@660:153
i@2:553
<unknown>@304:251
i@2:553
<unknown>@12:38
i@2:553
n@2:266
global code@671:9
- For Android, setup release configurations.
- Open the Terminal and run:
sudo react-native run-android --variant=release
. - After the build is successful, the app is deployed to the connected device, then crashes with the following message (from logs):
--------- beginning of crash
10-27 17:52:08.151 18268-18313/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.storefinder_yj, PID: 18268
com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 's.View.propTypes.style'), stack:
<unknown>@659:2841
i@2:565
n@2:348
t@2:210
<unknown>@657:243
i@2:565
n@2:348
t@2:210
<unknown>@656:153
i@2:565
n@2:348
t@2:210
<unknown>@302:251
i@2:565
n@2:348
t@2:210
<unknown>@12:38
i@2:565
n@2:278
t@2:210
global code@667:9
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:56)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:40)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
at java.lang.Thread.run(Thread.java:761)
10-27 17:52:08.591 18268-18312/? E/ReactNativeJS: Module AppRegistry is not a registered callable module (calling unmountApplicationComponentAtRootTag)
- Following are the dependencies in
package.json
file:
"dependencies": {
"datejs": "^1.0.0-rc3",
"prop-types": "^15.6.0",
"react": "16.0.0-beta.5",
"react-native": "^0.49.3",
"react-native-elements": "^0.17.0",
"react-native-fbsdk": "^0.6.3",
"react-native-sqlite-2": "^1.5.0",
"react-native-vector-icons": "^4.4.2",
"react-navigation": "^1.0.0-beta.15",
"rn-viewpager": "^1.2.4"
}
Expected Behavior
Application should run on the device without any crashes (in release mode).
Actual Behavior
Application builds successfully and deploys onto device. Then the app crashes once it opens. Screen shots are not available since the app crashes and closes, or is just a blank screen.
Reproducible Demo
Unable to create a reproducible demo.
Issue Analytics
- State:
- Created 6 years ago
- Comments:47
Top Results From Across the Web
Android release build crashes using react-native (0.68.2) in ...
After installing the app, on opening, it crashes as soon as it opens. On observing the error, it looks like there is a...
Read more >Fixing React-Native android release build - wesionaryTEAM
Android release build crashes on launch but works fine in development mode. After months of research and development, your app is finally ready...
Read more >Crashes - Android Developers
An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.
Read more >Customize your Firebase Crashlytics crash reports - Google
Customize your Firebase Crashlytics crash reports · On this page · Add custom keys · Add custom log messages · Set user identifiers...
Read more >ReactNative App Crashes when Deployed to TestFlight
Your app crashed due to an unhandled language exception. Looking at frames 3 through 2 in the Last Exception Backtrace you posted, it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is clearly showing that some package is still using View.propTypes. I was running into this too until I did find the offending packages. Please do the following:
The first step removes all the map files so that your grep output is not flooded. You will need to reinstall node_modules later so that you get them back.
Please check thoroughly the output of the second. You can either post output here or send them to me privately. I just went through the pain myself and would like to help you.
No worries. You have to check the entire dependency tree for
All three are illegal in React 16. The fixes for those are respectively:
My approach was this. Check each of those projects on GitHub and see:
I had to do all three 😃. The tricky part was when the direct dependency was clean, but a sub-dependency was not. I then had to fork both the direct dependency and its sub-dependency, fix the issue in the sub-dependency fork, change the my fork of the main dependency to use my fork of the sub-dependency.
As you can see, a bloody pain in the proverbial backside! But once I figured out the problem, it took me just a few hours to hit them all.
Good luck!