repack icon indicating copy to clipboard operation
repack copied to clipboard

react-native-svg crashing in release in TesterApp

Open oblador opened this issue 4 years ago • 3 comments

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

oblador avatar Oct 09 '21 09:10 oblador

For me at least it works if I run #106 instead of main branch (also works after rebase).

oblador avatar Oct 09 '21 10:10 oblador

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.

zamotany avatar Oct 11 '21 08:10 zamotany

react-native-svg throws the same error with RN 0.66 (tested on #106).

zamotany avatar Oct 14 '21 15:10 zamotany

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 ?

jbinda avatar Nov 22 '22 08:11 jbinda

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 🤔

shravansrinivas avatar Oct 30 '23 11:10 shravansrinivas

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.

github-actions[bot] avatar Feb 11 '24 00:02 github-actions[bot]

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.

github-actions[bot] avatar Feb 26 '24 00:02 github-actions[bot]