samedi 25 juin 2016

Native runtime error with React Native app obfuscating code in release builds

I am attempting to create a release build of my React Native application. I am able to compile it and package it with the JS bundle. It works fine in debug mode. But, when I assemble in release mode, I get these errors thrown at runtime by JNI as soon as the first RN view is displayed.

I am using proguard rules very similar to these. They are in addition to the proguard rules already applied to my app. In addition, multiDexEnabled and minifyEnabled are both set to true. When I include -dontobfuscate in proguard, the app works fine, even in release mode. When it is commented out, I get the error above. Code obfuscation is a requirement for release. What am I doing wrong?

EDIT: There is some discussion in this Github issue, but there has been no discussion since February and a question regarding commenting out -dontobfuscate went unanswered. The long stack trace posted by @kristjanmik on Feb 3 is exactly the same error I am encountering.

Aucun commentaire:

Enregistrer un commentaire