react-native: App is crashing on release Build (RN 0.54.4)

Environment

Environment: OS: macOS High Sierra 10.13.4 Node: 9.9.0 Yarn: 1.5.1 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.3 Build version 9E145 Android Studio: 2.2 AI-145.3537739

Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0 react-native: 0.54.4 => 0.54.4

Steps to Reproduce

Run a release build. Open Xcode. Go to edit schemes. Change the Run build configuration from Debug to Release. Or you can run it from terminal: react-native run-ios --configuration Release

Expected Behavior

JS bundle completes launch and app doesn’t crash.

Actual Behavior

App crashes when the JS bundle loads. Here is the crash log:

2018-04-01 19:32:57.938 [error][tid:com.facebook.react.JavaScript] undefined is not an object (evaluating 'u.View.propTypes.style')
2018-04-01 19:32:57.940 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: undefined is not an object (evaluating 'u.View.propTypes.style')
libc++abi.dylib: terminating with uncaught exception of type NSException

I ran grep to look form propTypes.style in my node_modules, but I did not see any use of View.propTypes: grep -R “propTypes.style” node_modules

node_modules/react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js:    imageStyle: Image.propTypes.style,
node_modules/react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js:    textStyle: Text.propTypes.style,
node_modules/react-native/Libraries/Components/TextInput/TextInput.js:    style: Text.propTypes.style,
node_modules/react-native-tab-view/src/TabBar.js:    labelStyle: Text.propTypes.style,
node_modules/react-native-autocomplete-input/index.js:    listStyle: ListView.propTypes.style,

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (3 by maintainers)

Most upvoted comments

For future googlers: Understanding the OP did this already, here’s what fixed it for me.

Hey all, I just experienced this issue the other day. In my case, I was using aws-appsync-react and it was using a previously-deprecated-now-removed feature View.propTypes.style, and it should have been using the new ViewPropTypes from the react-native package. You can see an example of the changes here:

https://github.com/jdeanwaite/aws-mobile-appsync-sdk-js/commit/421b5d340f24caa097f8031ae59c1e4a037350cf

What I did to find the problem was open the project in your IDE (I’m using WebStorm) and search for View.propTypes.style to identify which packages in your dependencies are using it. In my case there was a PR already available for the aws-appsync-react project that was pending. You might have to create your own PR for your particular use case, however it is a pretty easy change.

When you are searching, make sure node_modules is included in the search. Some IDEs exclude this by default.

@Lxxyx yes, in dev it is fine, only crashing for the release build.

Same thing happened with me, i am using RN 0.54.4 , in dev mode, it was perfectly fine, but release build is crashing, fast help would be grateful

I reverted the RN version back to 0.48.4 from 0.54.4.

So you, in the first place, updated from 0.48 to 0.54 without intermediate steps? Then is safe to assume that something went wrong with you upgrading your project across 6 different React Native versions.