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?
You can also use the ⌘D keyboard shortcut when your app is running in the iOS Simulator, or ⌘M when running in an Android emulator on macOS and Ctrl+M on Windows and Linux. Alternatively for Android, you can run the command adb shell input keyevent 82 to open the dev menu (82 being the Menu key code).
Clear App Data and Cache. It will help you delete the unnecessary app data that causes the crash: Go to Settings > Apps/Application manager > Choose the apps that crash frequently > Tap Clear data and Clear cache option.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With