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

[Android]Release crash l.View.propTypes.style #16352

Closed
cbjs opened this issue Oct 13, 2017 · 8 comments
Closed

[Android]Release crash l.View.propTypes.style #16352

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

Comments

@cbjs
Copy link

cbjs commented Oct 13, 2017

debug is fine, crash while release.

logcat dump.
`
10-13 10:28:08.810 9145 9194 E AndroidRuntime: com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'l.View.propTypes.style'), stack:
10-13 10:28:08.810 9145 9194 E AndroidRuntime: @1184:5578
10-13 10:28:08.810 9145 9194 E AndroidRuntime: i@2:565
10-13 10:28:08.810 9145 9194 E AndroidRuntime: n@2:348
10-13 10:28:08.810 9145 9194 E AndroidRuntime: t@2:210
10-13 10:28:08.810 9145 9194 E AndroidRuntime: @1183:197
10-13 10:28:08.810 9145 9194 E AndroidRuntime: i@2:565
10-13 10:28:08.810 9145 9194 E AndroidRuntime: n@2:348
10-13 10:28:08.810 9145 9194 E AndroidRuntime: t@2:210
10-13 10:28:08.810 9145 9194 E AndroidRuntime: @1182:113
10-13 10:28:08.810 9145 9194 E AndroidRuntime: i@2:565
10-13 10:28:08.810 9145 9194 E AndroidRuntime: n@2:348
10-13 10:28:08.810 9145 9194 E AndroidRuntime: t@2:210
10-13 10:28:08.810 9145 9194 E AndroidRuntime: @1180:311
10-13 10:28:08.810 9145 9194 E AndroidRuntime: i@2:565
10-13 10:28:08.810 9145 9194 E AndroidRuntime: n@2:348
10-13 10:28:08.810 9145 9194 E AndroidRuntime: t@2:210
10-13 10:28:08.810 9145 9194 E AndroidRuntime: @698:1008
10-13 10:28:08.810 9145 9194 E AndroidRuntime: i@2:565
10-13 10:28:08.810 9145 9194 E AndroidRuntime: n@2:348
10-13 10:28:08.810 9145 9194 E AndroidRuntime: t@2:210
10-13 10:28:08.810 9145 9194 E AndroidRuntime: @309:403
10-13 10:28:08.810 9145 9194 E AndroidRuntime: i@2:565
10-13 10:28:08.810 9145 9194 E AndroidRuntime: n@2:348
10-13 10:28:08.810 9145 9194 E AndroidRuntime: t@2:210
10-13 10:28:08.810 9145 9194 E AndroidRuntime: @12:44
10-13 10:28:08.810 9145 9194 E AndroidRuntime: i@2:565
10-13 10:28:08.810 9145 9194 E AndroidRuntime: n@2:278
10-13 10:28:08.810 9145 9194 E AndroidRuntime: t@2:210
10-13 10:28:08.810 9145 9194 E AndroidRuntime: global code@1260:9
10-13 10:28:08.810 9145 9194 E AndroidRuntime:
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:56)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:40)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:754)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at android.os.Looper.loop(Looper.java:160)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
10-13 10:28:08.810 9145 9194 E AndroidRuntime: at java.lang.Thread.run(Thread.java:761)

`

@react-native-bot
Copy link
Collaborator

@facebook-github-bot no-template

@facebook-github-bot
Copy link
Contributor

Hey, thanks for reporting this issue! It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce the issue being reported. I am going to close this, but feel free to open a new issue with the additional information provided. Thanks! See "What to Expect from Maintainers" to learn more.

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Oct 13, 2017
@timxyz
Copy link

timxyz commented Oct 20, 2017

We've been banging our heads against this issue for a few days. Seems like the cause was View.propTypes only being accessible from dev mode, meaning it is undefined in release. The fix is to switch it with ViewPropTypes.

Quote from View.js:

// `propTypes` should not be accessed directly on View since this wrapper only
  // exists for DEV mode. However it's important for them to be declared.
  // If the object passed to `createClass` specifies `propTypes`, Flow will
  // create a static type from it.
  propTypes: ViewPropTypes,

@pongponglau
Copy link

pongponglau commented Oct 21, 2017

I have the same problem in iOS 10 when running the app in release mode.

2017-10-21 22:52:35.287874+0800 MyApp[286:15231] Unhandled JS Exception: undefined is not an object (evaluating 'l.View.propTypes.style')

May i ask if there is any solution?

Thanks

@rcorrie
Copy link

rcorrie commented Oct 23, 2017

In order to solve this, make sure that your app nor any of your dependencies is using View.propTypes.

@pongponglau

tiberiumihai added a commit to tiberiumihai/react-native-facebook-login that referenced this issue Nov 6, 2017
Use ViewPropTypes instead.

View.propTypes is intended for DEV mode.
So, when I'm using this awesome library, in DEV mode it works perfectly fine, but as soon as I build the release version, it crashes.

Using react-native 0.50.0 with react 16.0.0.

More info here:
react-navigation/react-navigation#1352
facebook/react-native#16352
@ghost
Copy link

ghost commented Dec 2, 2017

Hello, is there any update for this? I'm having the same issue currently, I've resolved on the debug side by running jscodeshift -t react-codemod/transforms/React-PropTypes-to-prop-types.js <path>

nitaliano/react-native-mapbox-gl#832

But the app crashes in release mode

Update on this, it seems that react-native-router-flux with version 0.38.0 was causing the issue, since then I've updated to the beta version 4.0.0-beta.24 and this has now been resolved considering the guys fixed this in the beta version but the issue was still there in the older version having the latest version of react and react-native.

"react-native-router-flux": "4.0.0-beta.24",

@adjieindrawan
Copy link

@timxyz Thank you.. Works for me 🙏

@zhaiyjgithub
Copy link

search the code View.propTypes in your code and your third dependencies.
in the files:

  1. import {ViewPropTypes} from 'react-native'
  2. replace View.propTypes with ViewPropTypes

it works for me.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 13, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 13, 2018
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

8 participants