question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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: <unknown>@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: <unknown>@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: <unknown>@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: <unknown>@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: <unknown>@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: <unknown>@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: <unknown>@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)

`

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
timxyzcommented, 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,
6reactions
zhaiyjgithubcommented, Apr 11, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gradle - React Native App Debug mode works fine, Release ...
React Native App Debug mode works fine, Release mode crashes (App Registry and evaluating 'a.View.propTypes.style') ; – DennisFrea. Dec 2, 2017 ...
Read more >
Detect and diagnose crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >
keyboards that react to games
Hi all Another issue Im seeing, keyboard not working in the Sim but fine back in the menu,I have to crash the plane...
Read more >
Zillow Vermont Homes For Sale - vuubla.com
View listing photos nearby sales and find the perfect foreclosed homes for sale ... on Trulia Sort New Listings ranch-style-homes NEW - 1...
Read more >
Houses For Sale In Person County Nc - seoits.com is for sale
Browse photos see new properties get open house info and research neighborhoods on Trulia View pictures of homes review sales history and use ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found