-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NativeModules crashing in Release Builds #18204
Comments
Interesting. Can you try seeing if this still happens on CC: @hramos |
I upgraded to 0.54.0 (and updated my environment above) and the issue is still occurring. |
Thanks for the ping - I am unfamiliar with this area of the code. Did this regress recently? |
@scottschmitz Do you have proguard enabled? If so, can you try to disabling proguard and test if this still happens in Release mode? |
Thanks! It was in fact a proguard issue. I didn't realize that when I added React Native to my project that the proguard rules were not added into the folder with my other rules. |
The app runs perfectly fine in debug mode on Android. However, when I attempt to build a release version the app crashes whenever it attempts to call into the native module.
Environment
nvironment:
OS: macOS High Sierra 10.13.3
Node: 9.5.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.54.0 => 0.54.0
Expected Behavior
Native Module should be available inside of the JavaScript and not crash.
Actual Behavior
App crashes.
com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'c.NativeModules.ActivityModule.finishActivity'), stack:
Steps to Reproduce
ActivityModule.kt
MyReactPackage.kt
MainApplication.java
fake-navigation.js
Calling the
finish()
function above crashes the appThe text was updated successfully, but these errors were encountered: