React Native - Android App Running with Debug, Crash on Release

I use React Native v0.19, and when working on Android, my application works fine on Debug, but it crashes immediately when I run it in Release mode or from a signed release apk. Android Studio gives an error message:

02-01 13:16:40.650 12399-12424/? E/ReactNativeJS: undefined is not an object (evaluating 's.propTypes.style') 

How can i fix this?

+5
source share
1 answer

This is an error that occurs because two classes have been ported to another package version v0.19 of React Native: ReactProp ReactPropGroup . To fix this error, open 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>; } 

Link:

+5
source

Source: https://habr.com/ru/post/1243100/


All Articles