Crashing on Android
Anyone else experiencing crashing on Android?
Details here: https://github.com/facebook/react-native/issues/6760
I have no idea about what happened here. And we are no longer depend on ReactNativeART anymore
I tried both versions react-native-svg and react-native-art-svg and they both seem to crash on random intervals. I found that it does not crash when you turn off debug mode. I don't know why exactly.
You can use the other link's issue to see an example project that crashes in debug mode only:
import React, { Text, View } from 'react-native'; const { Surface, Group, Shape } = React.ART;
If the new version doesn't use React.ART I don't know why it would still behave the same...
We're seeing this too, random crashes due to this package. (Android only)
+1
I've run into the same issue with both packages. Interesting for me it doesn't crash when debugging in Chrome, but will consistently crash when it is not.
Clues are badly needed.
Has anyone posted the crash debug info needed to help trouble-shoot this?
I am afraid to invest time in using this component with this issue #38 active
@esutton Crash logs are posted here: https://github.com/facebook/react-native/issues/6760
Some android phones crash on a ReflectiveOperationException with a SIGSEGV while others throw it correctly. gson suffered from this too: https://github.com/google/gson/issues/817
So it may be that a call to newInstance somewhere is the culprit. An argument might be null or something like that. Search gives me:
Can consistently reproduce with this app:
https://gogs.sr.ht/SirCmpwn/sotp/src/eef40c5449ef9abe1c994d3f74232e3250293893
This is also crashing for me on random intervals... crashing is increased when animating.
Here is a stack trace from an android crash. Caused by setNativeProps of the transform of a
Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'transform' of a view managed by: RNSVGSvgView
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:88)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:34)
at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:121)
at com.facebook.react.uimanager.UIViewOperationQueue$UpdatePropertiesOperation.execute(UIViewOperationQueue.java:91)
at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:782)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829)
at com.facebook.react.uimanager.UIViewOperationQueue.pauseFrameCallback(UIViewOperationQueue.java:823)
at com.facebook.react.uimanager.UIImplementation.onHostPause(UIImplementation.java:611)
at com.facebook.react.uimanager.UIManagerModule.onHostPause(UIManagerModule.java:115)
at com.facebook.react.bridge.ReactContext.onHostPause(ReactContext.java:179)
at com.facebook.react.ReactInstanceManagerImpl.tearDownReactContext(ReactInstanceManagerImpl.java:794)
at com.facebook.react.ReactInstanceManagerImpl.access$500(ReactInstanceManagerImpl.java:99)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.onPreExecute(ReactInstanceManagerImpl.java:184)
at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:604)
at android.os.AsyncTask.execute(AsyncTask.java:551)
at com.facebook.react.ReactInstanceManagerImpl.recreateReactContextInBackground(ReactInstanceManagerImpl.java:727)
at com.facebook.react.ReactInstanceManagerImpl.onJSBundleLoadedFromServer(ReactInstanceManagerImpl.java:710)
at com.facebook.react.ReactInstanceManagerImpl.access$100(ReactInstanceManagerImpl.java:99)
at com.facebook.react.ReactInstanceManagerImpl$1.onJSBundleLoadedFromServer(ReactInstanceManagerImpl.java:138)
at com.facebook.react.devsupport.DevSupportManagerImpl$18$1.run(DevSupportManagerImpl.java:673)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:77)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:34)
at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:121)
at com.facebook.react.uimanager.UIViewOperationQueue$UpdatePropertiesOperation.execute(UIViewOperationQueue.java:91)
at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:782)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829)
at com.facebook.react.uimanager.UIViewOperationQueue.pauseFrameCallback(UIViewOperationQueue.java:823)
at com.facebook.react.uimanager.UIImplementation.onHostPause(UIImplementation.java:611)
at com.facebook.react.uimanager.UIManagerModule.onHostPause(UIManagerModule.java:115)
at com.facebook.react.bridge.ReactContext.onHostPause(ReactContext.java:179)
at com.facebook.react.ReactInstanceManagerImpl.tearDownReactContext(ReactInstanceManagerImpl.java:794)
at com.facebook.react.ReactInstanceManagerImpl.access$500(ReactInstanceManagerImpl.java:99)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.onPreExecute(ReactInstanceManagerImpl.java:184)
at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:604)
at android.os.AsyncTask.execute(AsyncTask.java:551)
at com.facebook.react.ReactInstanceManagerImpl.recreateReactContextInBackground(ReactInstanceManagerImpl.java:727)
at com.facebook.react.ReactInstanceManagerImpl.onJSBundleLoadedFromServer(ReactInstanceManagerImpl.java:710)
at com.facebook.react.ReactInstanceManagerImpl.access$100(ReactInstanceManagerImpl.java:99)
at com.facebook.react.ReactInstanceManagerImpl$1.onJSBundleLoadedFromServer(ReactInstanceManagerImpl.java:138)
at com.facebook.react.devsupport.DevSupportManagerImpl$18$1.run(DevSupportManagerImpl.java:673)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `double', but had type `object'
at com.facebook.react.bridge.ReadableNativeArray.getDouble(ReadableNativeArray.java)
at com.facebook.react.uimanager.BaseViewManager.setTransformMatrix(BaseViewManager.java:159)
at com.facebook.react.uimanager.BaseViewManager.setTransform(BaseViewManager.java:58)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:77)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:34)
at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:121)
at com.facebook.react.uimanager.UIViewOperationQueue$UpdatePropertiesOperation.execute(UIViewOperationQueue.java:91)
at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:782)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829)
at com.facebook.react.uimanager.UIViewOperationQueue.pauseFrameCallback(UIViewOperationQueue.java:823)
at com.facebook.react.uimanager.UIImplementation.onHostPause(UIImplementation.java:611)
at com.facebook.react.uimanager.UIManagerModule.onHostPause(UIManagerModule.java:115)
at com.facebook.react.bridge.ReactContext.onHostPause(ReactContext.java:179)
at com.facebook.react.ReactInstanceManagerImpl.tearDownReactContext(ReactInstanceManagerImpl.java:794)
at com.facebook.react.ReactInstanceManagerImpl.access$500(ReactInstanceManagerImpl.java:99)
at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.onPreExecute(ReactInstanceManagerImpl.java:184)
at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:604)
at android.os.AsyncTask.execute(AsyncTask.java:551)
at com.facebook.react.ReactInstanceManagerImpl.recreateReactContextInBackground(ReactInstanceManagerImpl.java:727)
at com.facebook.react.ReactInstanceManagerImpl.onJSBundleLoadedFromServer(ReactInstanceManagerImpl.java:710)
at com.facebook.react.ReactInstanceManagerImpl.access$100(ReactInstanceManagerImpl.java:99)
at com.facebook.react.ReactInstanceManagerImpl$1.onJSBundleLoadedFromServer(ReactInstanceManagerImpl.java:138)
at com.facebook.react.devsupport.DevSupportManagerImpl$18$1.run(DevSupportManagerImpl.java:673)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Did anyone find any solution or workaround for this issue? I am also facing it.
+1
I could solve this problem for my use case. In my case, I changed my image component with, shouldComponentUpdate() { return false; }
and my app is not crashing now. I don't exactly know what was the root cause of this problem, but definitely my component didn't need to be re-rendered every time.
@ggsrivas: This seems to work for me as well. Not sure if its a long term solution though.
Not sure if its a long term solution though.
Indeed. I actually animate this component as a core part of my app's functionality.
I agree. If you need animation then this solution will not work. Actually, in my application, I also have one svg image(loading spinner) which uses animation and my app is working without crash with this component. One way of finding out which element is causing crash is to remove svg elements one by one and see if your app is still crashing or not.
The reason might be because of this bug: https://github.com/facebook/fresco/issues/1363
Memory cleanup of animated images is broken in Fresco: https://github.com/facebook/fresco/issues/1363#issuecomment-233865933
I'm not sure if this ART commit is related with this problem. But I'll get this merged into react-native-svg see what would happen.
@magicismight Have you made progress on this? Our app (BlitzPick -- not yet available on Google Play, but it is available for iOS) uses react-native-svg for all of its icons, and we're having massive stability problems as we're trying to get it ready for public consumption.