react-native-svg crashing in release in TesterApp
Description
I've had some issues upgrading from 2.0.0 to 2.40 with android release mode specifically and when trying to reproduce it in the tester app I found similar issues, namely the following:
HermesVM: JSI rethrowing JS exception: Cannot read property 'descriptors' of undefined
HermesVM:
HermesVM: TypeError: Cannot read property 'descriptors' of undefined
HermesVM: at 72147 (address at index.android.bundle:1:574632)
HermesVM: at call (native)
HermesVM: at __webpack_require__ (address at index.android.bundle:1:8502)
HermesVM: at s (address at index.android.bundle:1:714061)
HermesVM: at 29896 (address at index.android.bundle:1:617628)
HermesVM: at call (native)
HermesVM: at __webpack_require__ (address at index.android.bundle:1:8502)
HermesVM: at s (address at index.android.bundle:1:714061)
HermesVM: at 59162 (address at index.android.bundle:1:620839)
HermesVM: at call (native)
HermesVM: at __webpack_require__ (address at index.android.bundle:1:8502)
HermesVM: at s (address at index.android.bundle:1:714061)
HermesVM: at 66232 (address at index.android.bundle:1:590168)
HermesVM: at call (native)
HermesVM: at __webpack_require__ (address at index.android.bundle:1:8502)
HermesVM: at s (address at index.android.bundle:1:714061)
HermesVM: at 18918 (address at index.android.bundle:1:33132)
HermesVM: at call (native)
HermesVM: at __webpack_requi
AndroidRuntime: FATAL EXCEPTION: mqt_js
AndroidRuntime: Process: com.testerapp, PID: 4878
AndroidRuntime: com.facebook.jni.UnknownCppException: Unknown
AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
Through git bisect I tracked it down to being caused by PR #81.
Reproducible Demo
cd packages/TesterApp/android
./gradlew clean
./gradlew assembleRelease
adb install ./app/build/outputs/apk/release/app-release.apk
For me at least it works if I run #106 instead of main branch (also works after rebase).
After investigating the issue, the crash is caused by react-native-svg itself in release mode. Debug works just fine.
Adding missing proguard rule and marking react-native-svg as nohoist doesn't solve the issue.
What's more interesting is that with Metro, react-native-svg doesn't crash but also doesn't render anything.
react-native-svg throws the same error with RN 0.66 (tested on #106).
Hey @zamotany and @oblador
We did some investigation with @lukewalczak and we've noticed that disabling hermes prevents app crash in production.
We also get report that it occurs in TesterApp based on V3 of Re.Pack and RN 0.68 🤔 - however weren't able to reproduce it.
Any ideas what can cause a conflict with enabling hermes ?
Hey @zamotany and @oblador
We did some investigation with @lukewalczak and we've noticed that disabling hermes prevents app crash in production.
We also get report that it occurs in TesterApp based on V3 of Re.Pack and RN 0.68 🤔 - however weren't able to reproduce it.
Any ideas what can cause a conflict with enabling hermes ?
I observed exactly the same behaviour when I disabled hermes with react-native version 0.72. Curious to understand what is hermes' implication here 🤔
This issue has been marked as stale because it has been inactive for 30 days. Please update this issue or it will be automatically closed in 14 days.
This issue has been automatically closed because it has been inactive for more than 14 days. Please reopen if you want to add more context.