react-native: [Android]Release crash "s.propTypes.style"
02-01 13:16:40.650 12399-12424/? E/ReactNativeJS: undefined is not an object (evaluating 's.propTypes.style')
02-01 13:16:40.670 12399-12425/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.reading, PID: 12399
com.facebook.react.modules.core.JavascriptException: <unknown>
index.android.bundle:18:31918
r
index.android.bundle:1:575
n
index.android.bundle:1:241
<unknown>
index.android.bundle:18:16832
r
index.android.bundle:1:575
n
index.android.bundle:1:241
<unknown>
index.android.bundle:18:15861
r
index.android.bundle:1:575
n
index.android.bundle:1:241
<unknown>
index.android.bundle:18:14713
r
index.android.bundle:1:575
n
index.android.bundle:1:241
<unknown>
index.android.bundle:18:13643
r
index.android.bundle:1:575
n
index.android.bundle:1:241
<unknown>
index.android.bundle:17:26122
r
index.android.bundle:1:575
n
index.android.bundle:1:241
<unknown>
index.android.bundle:1:11742
r
index.android.bundle:1:575
r
index.android.bundle:1:304
n
index.android.bundle:1:241
<unknown>
global code@index.android.bundle:19:25326
02-01 13:16:40.730 12399-12424/? E/ReactNativeJS: Module AppRegistry is not a registered callable module.
I found s.propTypes.style
in index.android.bundle
here:
g=o.createClass({displayName:"ScrollableTabView",statics:{DefaultTabBar:f},propTypes:{tabBarPosition:d.oneOf(["top","bottom"]),initialPage:d.number,page:d.number,onChangeTab:d.func,onScroll:d.func,renderTabBar:d.any,style:s.propTypes.style}
but debug is right, release crash. why?
react-native version: 0.19.0 used: react-native-scrollable-tab-view
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (8 by maintainers)
Commits related to this issue
- Fix proguard template for ReactProp and ReactPropGroup Summary: ReactProp and ReactPropGroup were moved in the annotations package but the proguard file was not updated accordingly. This caused apps ... — committed to facebook/react-native by janicduplessis 8 years ago
- Fix proguard template for ReactProp and ReactPropGroup Summary: ReactProp and ReactPropGroup were moved in the annotations package but the proguard file was not updated accordingly. This caused apps ... — committed to pglotov/react-native by janicduplessis 8 years ago
Hey Richard-Cao, thanks for reporting this issue!
React Native, as you’ve probably heard, is getting really popular and truth is we’re getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
react-native
or for more real time interactions, ask on Discord in the #react-native channel.it is very strange,my App crashes on release build in RN 0.49, debug release works fine. i check proguard-rules.pro file lin 45-46:
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } -keep class * extends com.facebook.react.bridge.NativeModule { *; } -keepclassmembers,includedescriptorclasses class * { native <methods>; } -keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; } -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; } -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
I found the problem, ReactProp and ReactPropGroup were moved to the annotations package and the proguard file was not updated accordingly.
To fix it you can change
for
in your proguard-rules.pro line 45-46
I’ll submit a PR to fix the templates.
I had the same problem, it ended up being an outdated module I was including.
https://github.com/d-a-n/react-native-modal-picker
I switched to an updated fork, and it worked
https://github.com/peacechen/react-native-modal-selector
@kristjanmik I was able to get past that error by adding the following proguard rule:
-keep class com.facebook.** { *; }
You can refer to this StackOverflow question for more info.