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 iOS and Android. Fatal Exeption. #16567

Closed
YeshanJay opened this issue Oct 27, 2017 · 47 comments
Closed

Release build crashes on iOS and Android. Fatal Exeption. #16567

YeshanJay opened this issue Oct 27, 2017 · 47 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@YeshanJay
Copy link

YeshanJay commented Oct 27, 2017

Is 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

  1. For iOS, open xcode and open the project.
  2. Setup release configurations.
  3. Connect a device, and click on run to deploy into device.
  4. 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
  1. For Android, setup release configurations.
  2. Open the Terminal and run: sudo react-native run-android --variant=release.
  3. 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)
  1. 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.

@ujwal-setlur
Copy link

ujwal-setlur commented Oct 27, 2017

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:

  1. find node_modules -name "*.map" | xargs -n 1 rm -f
  2. grep -R "View.propTypes" node_modules

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.

@ujwal-setlur
Copy link

Did you check just your dependencies or the sub-dependencies of your dependencies?

@YeshanJay
Copy link
Author

YeshanJay commented Oct 27, 2017

I checked only my dependencies.

I ran the commands you mentioned, and the second one printed a bunch of lines. And seems like View.propTypes is still being used in some of my dependencies (last time I only glanced around for React.propTypes).

These are the packages listed: react-native-elements, rn-viewpager

Thank you very much for helping out 😄

@ujwal-setlur
Copy link

No worries. You have to check the entire dependency tree for

  1. React.PropTypes
  2. PropTypes being imported from react
  3. Usage of View.propTypes

All three are illegal in React 16. The fixes for those are respectively:

  1. React.PropTypes -> PropTypes (import PropTypes from 'prop-types')
  2. Import PropTypes from prop-types instead of react
  3. View.propTypes -> ViewPropTypes (import ViewPropTypes from 'react-native')

My approach was this. Check each of those projects on GitHub and see:

  1. Has it been fixed in git already? Is there a new version available? If not, use the code from the github repo in your package.json
  2. Has someone issued a pull request for this? If so, use that branch.
  3. Fork the GitHub repo and fix it yourself

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!

@YeshanJay
Copy link
Author

hahaha.. I can only imagine what you went through. Thanks a lot again for saving so many hours mine 😄

@ujwal-setlur
Copy link

For anyone using code-push and running into app crashes on launch, see this:

microsoft/react-native-code-push#1064

@arma7x
Copy link

arma7x commented Oct 29, 2017

I'm downgrade to RN 0.45.1 to solve this.

@YeshanJay
Copy link
Author

I downgraded to RN 0.48.4 for now.

@iLevye
Copy link

iLevye commented Oct 29, 2017

In my case, upgrading react-native-admob 1.3.2 to 2.0.0-beta.2 solved situation.

@hironarita
Copy link

undefined is not an object (evaluating 'a.propTypes.style')

This is the error I get. I used grep -R 'a.propTypes.style' node_modules and it doesn't even find an instance where this code is executed... I'm confused.

@ujwal-setlur
Copy link

Don't include the 'a'. Please grep for propStyles.style? Is it attached to a View object? In my experience, it is one of the following:

  1. PropStyles imported from react
  2. Usage of React.PropStyles
  3. Usage of View.propStyles

Please check thoroughly for all three.

@ujwal-setlur
Copy link

Also check your own code

@hironarita
Copy link

@ujwal-setlur My grep for 'View.propTypes' outputs a lot of examples like style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style. Did you have to remove those too?

@ujwal-setlur
Copy link

No those are fine. Those are packages that are trying to be backwards compatible. They first check for ViewPropStyles and then for View.propStyles if ViewPropStyles is essentially null or undefined

@hironarita
Copy link

Those are the only instances where View.propTypes are being used. Nothing else... Strange.

@ujwal-setlur
Copy link

@hironarita did you check your code first? If so, good.

Unfortunately, you need to check the node_modules code minutely. Please also check for just propStyles.style.

Yes, this is a bloody pain. If you want you, you can send the output to me and I am happy to double-check for you

@ujwal-setlur
Copy link

@hironarita, can you list your dependencies and devDependencies from your package.json?

@hironarita
Copy link

@ujwal-setlur I checked my own code and there's no instances of View.propTypes.

Here's the output:

node_modules/@ptomasroos/react-native-multi-slider/DefaultMarker.js:const ViewPropTypes = require('react-native').ViewPropTypes || View.propTypes;
node_modules/@ptomasroos/react-native-multi-slider/MultiSlider.js:const ViewPropTypes = require('react-native').ViewPropTypes || View.propTypes;
node_modules/expo/node_modules/react-native-maps/lib/components/MapView.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/expo/node_modules/react-native-maps/lib/components/MapView.js:MapView.propTypes = propTypes;
node_modules/react/cjs/react.development.js: // ReactNative View.propTypes have been deprecated in favor of ViewPropTypes.
node_modules/react/umd/react.development.js: // ReactNative View.propTypes have been deprecated in favor of ViewPropTypes.
node_modules/react-native/docs/NativeComponentsAndroid.md: ...View.propTypes // include the default view properties
node_modules/react-native/docs/NativeComponentsAndroid.md:MyCustomView.propTypes = {
node_modules/react-native/docs/NativeComponentsIOS.md:MapView.propTypes = {
node_modules/react-native/docs/NativeComponentsIOS.md:MapView.propTypes = {
node_modules/react-native/docs/NativeComponentsIOS.md:MapView.propTypes = {
node_modules/react-native/Libraries/Animated/src/createAnimatedComponent.js: // ReactNative View.propTypes have been deprecated in favor of
node_modules/react-native/Libraries/Components/WebView/WebView.ios.js: decelerationRate: ScrollView.propTypes.decelerationRate,
node_modules/react-native/Libraries/Lists/ListView/ListView.js: ...ScrollView.propTypes,
node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js: // ReactNative View.propTypes have been deprecated in favor of
node_modules/react-native/Libraries/ReactNative/verifyPropTypes.js: // ReactNative View.propTypes have been deprecated in favor of
node_modules/react-native-invertible-scroll-view/InvertibleScrollView.js: ...ScrollView.propTypes,
node_modules/react-native-maps/lib/components/MapView.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapView.js:MapView.propTypes = propTypes;
node_modules/react-native-progress/Bar.js:const RNViewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-progress/Circle.js:const RNViewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-progress/CircleSnail.js:const RNViewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-progress/Pie.js:const RNViewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-scrollable-mixin/package.json: "readme": "# ScrollableMixin\n\nScrollableMixin lets your scrollable React Native components conform to a standard interface, making it easier to compose components. This lets you compose different types of ScrollView-like components while preserving the ScrollView API, including methods like scrollTo.\n\nSee react-native-scrollable-decorator for the decorator version of this mixin.\n\nnpm package\n\n## Installation\n\nnpm install react-native-scrollable-mixin\n\n\n## Usage\n\nAdd ScrollableMixin to your scrollable React components and implement getScrollResponder(), which must return the underlying scrollable component's scroll responder.\n\n## With JavaScript classes\n\nUse Object.assign to copy ScrollableMixin's functions to your class's prototype as instance methods:\n\njs\nclass InfiniteScrollView extends React.Component {\n static propTypes = {\n ...ScrollView.propTypes,\n renderScrollComponent: PropTypes.func.isRequired\n };\n\n /**\n * IMPORTANT: You must return the scroll responder of the underlying\n * scrollable component from getScrollResponder() when using ScrollableMixin.\n */\n getScrollResponder() {\n return this._scrollView.getScrollResponder();\n }\n\n setNativeProps(props) {\n this._scrollView.setNativeProps(props);\n }\n\n render() {\n let { renderScrollComponent, ...props } = this.props;\n return React.cloneElement(renderScrollComponent(props), {\n ref: component => { this._scrollView = component; },\n });\n }\n}\n\n// Mix in ScrollableMixin's methods as instance methods\nObject.assign(InfiniteScrollView.prototype, ScrollableMixin);\n\n\n### With React.createClass\n\njs\nlet ScrollableMixin = require('react-native-scrollable-mixin');\n\nlet InfiniteScrollView = React.createClass({\n mixins: [ScrollableMixin],\n\n propTypes: {\n ...ScrollView.propTypes,\n renderScrollComponent: PropTypes.func.isRequired,\n },\n\n /**\n * IMPORTANT: You must return the scroll responder of the underlying\n * scrollable component from getScrollResponder() when using ScrollableMixin.\n */\n getScrollResponder() {\n return this._scrollView.getScrollResponder();\n },\n\n setNativeProps(props) {\n this._scrollView.setNativeProps(props);\n },\n\n render() {\n var {\n renderScrollComponent,\n ...props\n } = this.props;\n return React.cloneElement(renderScrollComponent(props), {\n ref: component => { this._scrollView = component; },\n });\n },\n});\n\n\n## Features\n\nBy mixing in ScrollableMixin, your custom component gets the ScrollView API. For example:\n\njs\nclass App extends React.Component {\n render() {\n return (\n <ListView\n ref={component => this._scrollView = component}\n renderScrollView={props => <InfiniteScrollView {...props} />}\n dataSource={...}\n renderRow={...}\n />\n );\n }\n\n _scrollToTop() {\n // By having all scrollable components conform to ScrollableMixin's\n // standard, calling `scrollTo` on your top-level scrollable component will\n // successfully scroll the underlying scroll view.\n this._scrollView.scrollTo(0, 0);\n }\n}\n\n",
node_modules/react-native-scrollable-mixin/README.md: ...ScrollView.propTypes,
node_modules/react-native-scrollable-mixin/README.md: ...ScrollView.propTypes,
node_modules/react-native-scrollable-tab-view/package.json: "readme": "\n## react-native-scrollable-tab-view\nnpm version\n\nThis is probably my favorite navigation pattern on Android, I wish it\nwere more common on iOS! This is a very simple JavaScript-only\nimplementation of it for React Native. For more information about how\nthe animations behind this work, check out the Rebound section of the\nReact Native Animation Guide\n\n\n## Add it to your project\n\n1. Run npm install react-native-scrollable-tab-view --save\n2. var ScrollableTabView = require('react-native-scrollable-tab-view');\n\n## Demo\n<a href="https://appetize.io/embed/6qfv7eydjtm34mhn6qwj2nt3xm?embed=true&screenOnly=false&xdocMsg=true&debug=true&scale=100&deviceColor=black&orientation=portrait&device=iphone6s&osVersion=9.3&deviceId=RGV2aWNlOjU2Y2FjNTExZWQwOTM2MTEwMGRhYTNlNg&platform=ios&width=375&height=668&phoneWidth=416&phoneHeight=870&screenOffsetLeft=21&screenOffsetTop=100&params=%7B%7D\" target="_blank">Run this example\n\n<a href="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo.gif\"><img src="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo.gif\" width="350">\n<a href="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo-fb.gif\"><img src="https://raw.githubusercontent.com/brentvatne/react-native-scrollable-tab-view/master/demo_images/demo-fb.gif\" width="350">\n\n## Basic usage\n\njavascript\nvar ScrollableTabView = require('react-native-scrollable-tab-view');\n\nvar App = React.createClass({\n render() {\n return (\n <ScrollableTabView>\n <ReactPage tabLabel=\"React\" />\n <FlowPage tabLabel=\"Flow\" />\n <JestPage tabLabel=\"Jest\" />\n </ScrollableTabView>\n );\n }\n});\n\n\n## Injecting a custom tab bar\n\nSuppose we had a custom tab bar called CustomTabBar, we would inject\nit into our ScrollableTabView like this:\n\njavascript\nvar ScrollableTabView = require('react-native-scrollable-tab-view');\nvar CustomTabBar = require('./CustomTabBar');\n\nvar App = React.createClass({\n render() {\n return (\n <ScrollableTabView renderTabBar={() => <CustomTabBar someProp={'here'} />}>\n <ReactPage tabLabel=\"React\" />\n <FlowPage tabLabel=\"Flow\" />\n <JestPage tabLabel=\"Jest\" />\n </ScrollableTabView>\n );\n }\n});\n\nTo start you can just copy DefaultTabBar.\n\n## Examples\n\nSimpleExample.\n\nScrollableTabsExample.\n\nOverlayExample.\n\nFacebookExample.\n\n## Props\n\n- renderTabBar (Function:ReactComponent) - accept 1 argument props and should return a component to use as\n the tab bar. The component has goToPage, tabs, activeTab and\n ref added to the props, and should implement setAnimationValue to\n be able to animate itself along with the tab content. You can manually pass the props to the TabBar component.\n- tabBarPosition (String) Defaults to \"top\".\n - \"bottom\" to position the tab bar below content.\n - \"overlayTop\" or \"overlayBottom\" for a semitransparent tab bar that overlays content. Custom tab bars must consume a style prop on their outer element to support this feature: style={this.props.style}.\n- onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the tab that is selected\n- onScroll (Function) - function to call when the pages are sliding, should accept 1 argument which is an Float number representing the page position in the slide frame.\n- locked (Bool) - disables horizontal dragging to scroll between tabs, default is false.\n- initialPage (Integer) - the index of the initially selected tab, defaults to 0 === first tab.\n- page (Integer) - set selected tab(can be buggy see #126\n- children (ReactComponents) - each top-level child component should have a tabLabel prop that can be used by the tab bar component to render out the labels. The default tab bar expects it to be a string, but you can use anything you want if you make a custom tab bar.\n- tabBarUnderlineStyle (View.propTypes.style) - style of the default tab bar's underline.\n- tabBarBackgroundColor (String) - color of the default tab bar's background, defaults to white\n- tabBarActiveTextColor (String) - color of the default tab bar's text when active, defaults to navy\n- tabBarInactiveTextColor (String) - color of the default tab bar's text when inactive, defaults to black\n- tabBarTextStyle (Object) - Additional styles to the tab bar's text. Example: {fontFamily: 'Roboto', fontSize: 15}\n- style (View.propTypes.style)\n- contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid. Note that overriding defaults set by the library may break functionality; see the source for details.\n- scrollWithoutAnimation (Bool) - on tab press change tab without animation.\n- prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all the siblings, default to 0 === render current page.\n\n## Contribution\nIssues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.\n\nPull requests are welcome. If you want to change API or making something big better to create issue and discuss it first. Before submiting PR please run eslint . Also all eslint fixes are welcome.\n\nPlease attach video or gif to PR's and issues it is super helpful.\n\n<a href="http://www.abeautifulsite.net/recording-a-screencast-with-quicktime/\" target="_blank">How to make video\n\n<a href="https://github.com/jclem/gifify\" target="_blank">How to make gif from video\n\n---\n\nMIT Licensed\n",
node_modules/react-native-scrollable-tab-view/README.md:- tabBarUnderlineStyle (View.propTypes.style) - style of the default tab bar's underline.
node_modules/react-native-scrollable-tab-view/README.md:- style (View.propTypes.style)
node_modules/react-native-snap-carousel/CHANGELOG.md:* Use View.propTypes.style instead of PropTypes.number in styles validation (thanks @pesakitan22)
node_modules/react-native-snap-carousel/src/carousel/Carousel.js: containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/carousel/Carousel.js: contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/carousel/Carousel.js: slideStyle: Animated.View.propTypes.style,
node_modules/react-native-snap-carousel/src/pagination/Pagination.js: containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/pagination/Pagination.js: dotContainerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/pagination/Pagination.js: dotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/pagination/Pagination.js: inactiveDotStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js: containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js: inactiveStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/pagination/PaginationDot.js: style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-snap-carousel/src/parallaximage/ParallaxImage.js: containerStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,
node_modules/react-native-swipeout/dist/index.js: style: (_reactNative.ViewPropTypes || _reactNative.View.propTypes).style,
node_modules/react-native-swipeout/HISTORY.md:- fix: support old version react-native, support both View.propTypes and ViewPropTypes
node_modules/react-native-swipeout/src/index.js: style: (ViewPropTypes || View.propTypes).style,
node_modules/react-native-textinput-effects/lib/BaseInput.js: style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style,

@hironarita
Copy link

hironarita commented Oct 30, 2017

"dependencies": {
"expo/react-native-responsive-image": "^1.2.1",
"ptomasroos/react-native-multi-slider": "0.0.11",
"accounting": "^0.4.1",
"axios": "^0.17.0",
"expo": "^22.0.0",
"lodash": "4.17.4",
"moment": "^2.19.1",
"query-string": "^5.0.1",
"querystring": "^0.2.0",
"react": "16.0.0-beta.5",
"react-native": "https://github.com/expo/react-native/archive/sdk-22.0.1.tar.gz",
"react-native-animatable": "^1.2.4",
"react-native-check-box": "2.0.2",
"react-native-checkbox": "^1.2.0",
"react-native-gifted-chat": "^0.2.9",
"react-native-google-places-autocomplete": "^1.3.6",
"react-native-keyboard-aware-scroll-view": "^0.4.1",
"react-native-linear-gradient": "^2.3.0",
"react-native-maps": "^0.17.1",
"react-native-masked-text": "^1.6.2",
"react-native-modal": "^4.1.0",
"react-native-modalbox": "^1.4.2",
"react-native-progress": "^3.4.0",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-snap-carousel": "^3.3.4",
"react-native-swipe-gestures": "^1.0.2",
"react-native-swipeout": "^2.3.1",
"react-native-textinput-effects": "^0.4.1",
"react-native-wkwebview-reborn": "^1.10.0",
"react-navigation": "^1.0.0-beta.15",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"reselect": "^3.0.1"
}

@ujwal-setlur
Copy link

Ok, I will check these in the morning.

@hironarita
Copy link

Thank you so much.

@gameboyVito
Copy link

After spending tons of time to find out a better solution, I found out there's no need to modify all 3rd party library. The tricky part is to make sure your dev dependencies are correct and use react-native@0.49.5 to build your release. Run react-native-git-upgrade 0.49.5

"devDependencies": {
    "babel-jest": "21.2.0",
    "babel-preset-react-native": "4.0.0",
    "jest": "21.2.1",
    "react-test-renderer": "16.0.0-beta.5"
  },

@musicode
Copy link

musicode commented Nov 1, 2017

modify react/index.js

'use strict';

import PropTypes from 'prop-types';

let React;
if (process.env.NODE_ENV === 'production') {
  React = require('./cjs/react.production.min.js');
} else {
  React = require('./cjs/react.development.js');
}

React.PropTypes = PropTypes;

module.exports = React;

@ZKeLin
Copy link

ZKeLin commented Nov 2, 2017

@ujwal-setlur you are right .I have solued it. I spent too much time for this problem due to another no updated module, it's too painful , thanks so much

@scue
Copy link

scue commented Nov 3, 2017

@ujwal-setlur Thank you very much!

I change

"react-native-elements": "^0.17.0",

to:

"react-native-elements": "github:react-native-training/react-native-elements#v0.18.0",

and everything go well.

@ujwal-setlur
Copy link

glad my pain made yours' shorter :-)

@ftb2010
Copy link

ftb2010 commented Nov 7, 2017

@ujwal-setlur The same code RN0.49.5 Android Release is ok,but when i update from RN0.49.5 to RN0.50.1 Android Release crash again!Any suggestion?

@ujwal-setlur
Copy link

I haven't moved to 0.50 yet. Will look at it today.

@phu-tang
Copy link

phu-tang commented Nov 16, 2017

thanks, but is there any way to work around. let say, I use a lot of lib in my project it's very hard to fix all of them. :( and why this problem only happened in release version?

@shubhanshusingh
Copy link

How I solved this:

  1. grep -R "View.propTypes" node_modules
    above command fetches me list of all packages to update in my case ex. rn-viewpager,react-native-material-ui etc.

  2. Installed and cloned these scripts. https://github.com/reactjs/react-codemod#reactnative-view-proptypes

  3. ran command for each module found in step 1 https://github.com/reactjs/react-codemod#reactnative-view-proptypes

@dhanushuUzumaki
Copy link

dhanushuUzumaki commented Jan 7, 2018

I think I don't have any dependencies using View.PropTypes but still release variant crashes.
Using RN 0.51.0

Here is my output of the grep.

node_modules/react-native/Libraries/Lists/ListView/ListView.js: ...ScrollView.propTypes,
node_modules/react-native/Libraries/Components/WebView/WebView.ios.js: decelerationRate: ScrollView.propTypes.decelerationRate,
node_modules/react-native/Libraries/ReactNative/verifyPropTypes.js: // ReactNative View.propTypes have been deprecated in favor of
node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js: // ReactNative View.propTypes have been deprecated in favor of
node_modules/react-native/Libraries/Animated/src/createAnimatedComponent.js: // ReactNative View.propTypes have been deprecated in favor of

Any help would be appreciated.

Thanks.

Update: Jan 8 2017. Downgrading to RN 0.45.1 and React 16.0.0-alpha.8 solved the issue for me.

@dvisco
Copy link

dvisco commented Jan 19, 2018

I had to update my dependencies to utilize the new ViewPropTypes convention. Curious though why does this break in release builds and not in dev builds? Would love a deeper understanding of why i only caught this when testing on our staging environments.

@jaycee425
Copy link

Curios about it too, since had the same problem

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added 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. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@JoseVf
Copy link

JoseVf commented Feb 26, 2018

Still facing this issue in V. 0.53.3.

@ospfranco
Copy link
Contributor

ospfranco commented Feb 26, 2018

I'm also having this problem on v0.53.3, but I cannot pin point the culprit library

@YogeshYo
Copy link

YogeshYo commented Feb 27, 2018

XXXX:ReactWork $ grep -R "View.propTypes" node_modules
node_modules/react-native/Libraries/Components/WebView/WebView.ios.js: decelerationRate: ScrollView.propTypes.decelerationRate,
node_modules/react-native/Libraries/Lists/ListView/ListView.js: ...ScrollView.propTypes,
node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js: // ReactNative View.propTypes have been deprecated in favor of
node_modules/react-native/Libraries/ReactNative/verifyPropTypes.js: // ReactNative View.propTypes have been deprecated in favor of
node_modules/react-native-maps/CHANGELOG.md:* Common: #1792 Make all components use ViewPropTypes || View.propTypes
node_modules/react-native-maps/lib/components/MapCallout.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapCircle.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapLocalTile.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapMarker.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapPolygon.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapPolyline.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapUrlTile.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapView.js:const viewPropTypes = ViewPropTypes || View.propTypes;
node_modules/react-native-maps/lib/components/MapView.js:MapView.propTypes = propTypes;

iOS & Android release build crashes on application launch.
**PAckage i think may have relation are **
"react-native-image-picker": "^0.26.7",
"react-native-maps": "^0.19.0",

Log
02-23 12:22:38.167 15888 15924 E AndroidRuntime: com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 't.refs.customMultiPicker.refs'), stack:
02-23 12:22:38.167 15888 15924 E AndroidRuntime: @545:6089
02-23 12:22:38.167 15888 15924 E AndroidRuntime: @23:1126
02-23 12:22:38.167 15888 15924 E AndroidRuntime: a@23:488
02-23 12:22:38.167 15888 15924 E AndroidRuntime: callTimers@23:2538
02-23 12:22:38.167 15888 15924 E AndroidRuntime: value@18:3223
02-23 12:22:38.167 15888 15924 E AndroidRuntime: @18:957
02-23 12:22:38.167 15888 15924 E AndroidRuntime: value@18:2652
02-23 12:22:38.167 15888 15924 E AndroidRuntime: value@18:929
02-23 12:22:38.167 15888 15924 E AndroidRuntime:

@intimateo
Copy link

after three days fighting with this issue I use the solution of @dhanushuUzumaki
just Downgrading to RN 0.45.1 and React 16.0.0-alpha.8 solved the issue for me.

@brianinator
Copy link

I followed the steps to transverse dependencies and sub dependencies. I discovered gl-react and react-native-google-places-autocomplete to be bad eggs in my case. gl-react I upgraded to 2.3.1 and I use the other internally so I removed the usage of React.createClass. A coworker suggested that maybe we be more strict on warnings via eslint. (https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md)

@MaxInMoon
Copy link

react-native-multi-slider was the cause for me with react-native@0.53.3

@mosleim
Copy link

mosleim commented Oct 2, 2018

why this closes? have someone have a solution for this problem?

here:

  "dependencies": {
    "@babel/runtime": "^7.1.2",
    "native-base": "^2.8.0",
    "react": "16.5.0",
    "react-native": "0.57.1",
    "react-native-charts-wrapper": "^0.4.8",
    "react-navigation": "^2.17.0"
  }

still crash on iOS or on Android.

@vijendraReactWhiz
Copy link

i am getting same issue when i have create the release build and install in real device please help me

--------- beginning of crash
2018-11-26 22:23:16.098 28622-28686/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: chat.sutras, PID: 28622
com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'U.startApp'), stack:
o@620:43
a@616:363
H@346:3196
@343:1119
n@2:565
i@2:348
t@2:210
@13:37
n@2:565
i@2:348
t@2:210
@12:24
n@2:565
i@2:278
t@2:210
global code@1113: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:374)
    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:808)
    at android.os.Handler.dispatchMessage(Handler.java:101)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
    at android.os.Looper.loop(Looper.java:166)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
    at java.lang.Thread.run(Thread.java:784)

@quangas
Copy link

quangas commented Dec 4, 2018

Same for me.

The error is so cryptic, its difficult to find what the issue is. This is only a problem in Android and not iOS.

E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    com.facebook.react.common.JavascriptException: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
    
    This error is located at:
        in RCTView
        in RCTView
        in t, stack:
    Ut@41:25232
    <unknown>@41:68662
    o@41:38127
    beginWork@41:78770
    n@41:104185
    i@41:104526
    o@41:104872
    k@41:109051
    C@41:108594
    v@41:107821
    p@41:107100
    d@41:106788
    t@41:61896
    updateContainer@41:123598
    render@41:69194
    exports@280:730
    run@276:615
    runApplication@276:2046
    value@18:3582
    <unknown>@18:1067
    value@18:3009
    value@18:1039

@shivamsaigupta
Copy link

I'm facing the same issue. Please help.

01-24 18:11:58.068 20736 20770 E ReactNativeJS: null is not an object (evaluating 't.uid')
01-24 18:11:58.083 20736 20771 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
01-24 18:11:58.083 20736 20771 E AndroidRuntime: Process: com.adourapp, PID: 20736
01-24 18:11:58.083 20736 20771 E AndroidRuntime: com.facebook.react.common.JavascriptException: null is not an object (evaluating 't.uid'), stack:
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@834:304
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@339:171
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@341:1766
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@850:3761
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@46:1362
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@796:952
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@46:1362
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@720:523
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@46:1362
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@25:3449
01-24 18:11:58.083 20736 20771 E AndroidRuntime: <unknown>@25:960
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@25:2703
01-24 18:11:58.083 20736 20771 E AndroidRuntime: value@25:932

@facebook facebook locked as resolved and limited conversation to collaborators Feb 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests