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
I am also getting error on Android.
Here is the error report.
Error while updating prop d
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:99)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:150)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:52)
at com.facebook.react.uimanager.ReactShadowNode.updateProperties(ReactShadowNode.java:176)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:163)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:205)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:139)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:158)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:818)
Caused by: com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError: expected dynamic type `double', but had type `null'
at com.facebook.react.bridge.ReadableNativeArray.getDouble(Native Method)
at com.horcrux.svg.PropHelper.toFloatArray(PropHelper.java:54)
at com.horcrux.svg.PropHelper.toFloatArray(PropHelper.java:35)
at com.horcrux.svg.RNSVGPathShadowNode.setPath(RNSVGPathShadowNode.java:71)
at java.lang.reflect.Method.invoke(Native Method)Â
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:99)Â
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:150)Â
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:52)Â
at com.facebook.react.uimanager.ReactShadowNode.updateProperties(ReactShadowNode.java:176)Â
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:163)Â
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:205)Â
at java.lang.reflect.Method.invoke(Native Method)Â
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)Â
at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:139)Â
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)Â
at android.os.Handler.handleCallback(Handler.java:739)Â
at android.os.Handler.dispatchMessage(Handler.java:95)Â
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)Â
at android.os.Looper.loop(Looper.java:158)Â
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)Â
at java.lang.Thread.run(Thread.java:818)Â
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.
@dacarley Sorry about that,I'll get that commit merged today.
@magicismight Sorry to harp, but have you been able to get to this?
I'm working on it, found it's not that easy to get that commit merged into svg.
It have to change the SvgView into a subclass from TextureView.
That introduces many new problems.
We have changed the SvgView into a subclass from ViewGroup insteadof View for some reasons.
So that changed many things.
Hi @magicismight,
Is there any update on this?
Thanks!
@mlabrum
There are something went wrong with the Image, TouchEvents and onDataURL().
Maybe will be finished in 2 days.
But I cannot guarantee this.
@dacarley DONE.
Released in [email protected]
But I'm not sure if this has been fixed, can't find a way to test it.
Thanks! We’ll upgrade shortly.
On November 8, 2016 at 7:23:26 AM, Horcrux ([email protected]) wrote:
@dacarley https://github.com/dacarley DONE.
Released in [email protected]
But I'm not sure if this
https://github.com/facebook/react-native/issues/6760 has been fixed,
can't find a way to test it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-native-community/react-native-svg/issues/38#issuecomment-259165867,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA60g-JDaOdPxvX3mYPdUpb6DajPY7zzks5q8JPtgaJpZM4Icf4e
.
@magicismight thank you for landing this change! Good news is, that our use case of react-native-svg, the app is now more stable on version 4.3.2, and does not crash as often. The rendering performance also feels faster, by a subjective measure.
The bad news is that it still crashes occasionally with the same error message as https://github.com/facebook/react-native/issues/6760, so this does not fix the root cause of the issue.
11-09 17:49:48.962 1515 1534 W WindowAnimator: Failed to dispatch window animation state change.
11-09 17:49:48.962 1515 1534 W WindowAnimator: android.os.DeadObjectException
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.os.BinderProxy.transactNative(Native Method)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.os.BinderProxy.transact(Binder.java:503)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.view.Choreographer.doCallbacks(Choreographer.java:670)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.view.Choreographer.doFrame(Choreographer.java:603)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.os.Handler.handleCallback(Handler.java:739)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.os.Handler.dispatchMessage(Handler.java:95)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.os.Looper.loop(Looper.java:148)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at android.os.HandlerThread.run(HandlerThread.java:61)
11-09 17:49:48.962 1515 1534 W WindowAnimator: at com.android.server.ServiceThread.run(ServiceThread.java:46)
Any news? It still crashes for me =(
+1
+1
This still crashes randomly in v 4.4.1 against React Native 0.39.2 for what appears to be the same reasons (Fatal signal 11 (SIGSEGV) at 0x67110038 (code=2)). Much more likely to happen on views with significant SVG use. For now I have had to remove a fair amount of SVGs in the view to get the app stable-ish. I also noticed that the changes for 4.3.2 mentioned above by @magicismight had been reverted, curious as to why?
FTR the crash goes away completely when when I remove all SVGs from views, until this bug is ironed out I won't be able to consider my app production ready as it makes it somewhat unstable and is now missing a fair amount of UI work. This crash never happens on the apps iOS counterpart which shares most of the js code.
Just wanted to understand that if this is still a known issue that appears to be fixable?
This is still a known issue in ReactNativeART and react-native-svg.
I have no idea what's going wrong.
maybe it's the parsed path data send to JSBridge caused the problem.
I'll try to parse the d prop in native side and see what happened.
Good news!
I have fixed this finally.
It's the JSBridge caused the crash.
The d prop in Path element is too large after serialized.
And I had moved the serialize part to java side, and it never throw A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9fa40028 in tid 4388 (mqt_js) again.
I'll ship this fix in next version
@magicismight amazing! We'll test this ASAP.
Awesome thank you looking forward to checking it out!
On Jan 5, 2017, at 4:06 AM, Jani Eväkallio notifications@github.com wrote:
@magicismight amazing! We'll test this ASAP.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
I have pushed the commits to a new branch.
Now just have finished the Android code and will finish the iOS code in maybe this weekend.
Thank you!
4.6.0 has been released.
And I think it's time to close this issue now.
The crash caused by A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0xxxxxxxx in tid xxxx (mqt_js) has been fixed.
The crash caused by other errors should be posted in other issues.
I updated react-native-svg to 4.6.0 and react-native to 0.40.0 and crashes are less frequently but problem still exists.
Most helpful comment
Good news!
I have fixed this finally.
It's the JSBridge caused the crash.
The
dprop in Path element is too large after serialized.And I had moved the serialize part to java side, and it never throw
A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9fa40028 in tid 4388 (mqt_js)again.I'll ship this fix in next version