React-native-chart-kit: App crashed in release

Created on 4 Jun 2020  路  11Comments  路  Source: indiespirit/react-native-chart-kit

I used simple barchart, it is all ok when working on debug mode, after I make a release build for android and test in phone, it crashed

Most helpful comment

@emp3ror if you're using proguard-rules, you need to insert this line in your android/app/proguard-rules.pro:
-keep public class com.horcrux.svg.* {;}

All 11 comments

Needs more info, simple barchart working for me in a production android application.

Needs more info, simple barchart working for me in a production android application.

How can I get production errors? it simply crashes

Link

Here is a link to some resources describing how to explore crashes in production Android.

@emp3ror if you're using proguard-rules, you need to insert this line in your android/app/proguard-rules.pro:
-keep public class com.horcrux.svg.* {;}

@emp3ror you checked quantity of data? Maybe you tried render many data and device crash.

I am having a same issue, when I am using a basic line chart. The app crashed when navigate to the screen with line chart.

Having the same issue, except mine crashes in Dev Mode. Only Android and only if the LineChart is being rendered to the screen.

Android Studio spits out this error:


java.lang.ArrayIndexOutOfBoundsException



E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp, PID: 13480
java.lang.ArrayIndexOutOfBoundsException
at android.graphics.DashPathEffect.(DashPathEffect.java:36)
at com.horcrux.svg.RenderableView.setupStrokePaint(RenderableView.java:466)
at com.horcrux.svg.RenderableView.draw(RenderableView.java:380)
at com.horcrux.svg.RenderableView.render(RenderableView.java:339)
at com.horcrux.svg.GroupView.drawGroup(GroupView.java:104)
at com.horcrux.svg.GroupView.draw(GroupView.java:81)
at com.horcrux.svg.RenderableView.render(RenderableView.java:339)
at com.horcrux.svg.GroupView.drawGroup(GroupView.java:104)
at com.horcrux.svg.GroupView.draw(GroupView.java:81)
at com.horcrux.svg.RenderableView.render(RenderableView.java:339)
at com.horcrux.svg.GroupView.drawGroup(GroupView.java:104)
at com.horcrux.svg.GroupView.draw(GroupView.java:81)
at com.horcrux.svg.RenderableView.render(RenderableView.java:339)
at com.horcrux.svg.SvgView.drawChildren(SvgView.java:304)
at com.horcrux.svg.SvgView.drawOutput(SvgView.java:255)
at com.horcrux.svg.SvgView.onDraw(SvgView.java:106)
at android.view.View.draw(View.java:20370)
at android.view.View.updateDisplayListIfDirty(View.java:19315)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at android.view.View.draw(View.java:20373)
at android.widget.ScrollView.draw(ScrollView.java:2731)
at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:465)
at android.view.View.updateDisplayListIfDirty(View.java:19315)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.draw(View.java:20373)
at android.view.View.updateDisplayListIfDirty(View.java:19315)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
E/AndroidRuntime: at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.draw(View.java:20373)
at android.view.View.updateDisplayListIfDirty(View.java:19315)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.View.draw(View.java:20093)
at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:703)
at android.view.View.updateDisplayListIfDirty(View.java:19306)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
at android.view.View.updateDisplayListIfDirty(View.java:19274)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
at android.view.View.updateDisplayListIfDirty(View.java:19274)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
at android.view.View.updateDisplayListIfDirty(View.java:19274)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
at android.view.View.updateDisplayListIfDirty(View.java:19274)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
at android.view.View.updateDisplayListIfDirty(View.java:19274)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
at android.view.View.updateDisplayListIfDirty(View.java:19274)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:800)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3496)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3283)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2818)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1780)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7817)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

I'm not sure if this is an issue on react-native-svg or here though.

@emp3ror You can add this line: -keep public class com.horcrux.svg.** { *; } to android/app/proguard-rules.pro, it fixed to me.

@emp3ror You can add this line: -keep public class com.horcrux.svg.** { *; } to android/app/proguard-rules.pro, it fixed to me.

If you enabled ProGuard this rule should fix the issue!

@emp3ror if you're using proguard-rules, you need to insert this line in your android/app/proguard-rules.pro:
-keep public class com.horcrux.svg.* {;}

This worked for me . App was working in debug mode but crashed in prod build. Thanks @henrineken

I've the same problem and it resolved by this line :
-keep public class com.horcrux.svg.** {*;}

So thanks @henrineken

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NS-BOBBY-C picture NS-BOBBY-C  路  5Comments

stebogit picture stebogit  路  3Comments

bhoomika911 picture bhoomika911  路  4Comments

bailih picture bailih  路  4Comments

dahudson88 picture dahudson88  路  5Comments