Reputation: 2111
I'm using React Native v0.19, and when running on Android my app works just fine on Debug, but immediately crashes when I run it in Release mode, or from the signed release apk. Android Studio throws an error:
02-01 13:16:40.650 12399-12424/? E/ReactNativeJS: undefined is not an object (evaluating 's.propTypes.style')
How can I fix this?
Upvotes: 6
Views: 2709
Reputation: 2111
This is a bug that happens because two classes were moved to another package on version v0.19 of React Native: ReactProp
ReactPropGroup
. To fix this error, open your proguard-rules.pro
and edit the following lines:
-keepclassmembers class * { @com.facebook.react.uimanager.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup <methods>; }
for:
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
Reference:
Upvotes: 5