Open d4vidi opened 4 years ago
We're exhibiting this issue too, -- we just leapfrogged from RN 0.59 and RN 0.62 and without this Github Issue, we were blocked in Production Release Verification & QA which is bad when you have deadlines! Thanks a lot @d4vidi!
@d4vidi You sir are awesome :D Thank you for this 👍
Environment
Upgrading version
0.61.x
->0.62.0
Problem
Exception after most Android-native related upgrade changes are in-effect:
(Ignored lots of consequent errors here)
Solution
This happens only when minification is enabled --
com.facebook.jni.NativeRunnable
gets stripped out, and even thoughNativeRunnable
has the@DoNotStrip
annotation.The problem is that RN's self proguard settings are incomplete. This section allegedly should do the trick here:
But it doesn't. Adding this to your app's proguard rules should solve both that and potentially similar problems:
Explanation: there are several
DoNotStrip
annotations going around in RN's and its deps. In particular, this adds the missingcom.facebook.jni.annotations.DoNotStrip
annotation for keeping class members, and, more importantly, applies all knownDoNotStrip
over classes (that includes theNativeRunnable
class).I'll consider PR-ing this.