Android - Trial crashing in Release build


#1

Hello,

I just tried to create a release build of the Shinobi trial for our business owners to test with.  It is crashing immediately once I try to display a chart.  Could you provide me with some insight in how to get around the issue.  For now, I going to send them a debug build, but that is not our usual process.

Thank you for your help

java.lang.NoSuchFieldError: no field with name='nativeHandle' signature='J' in class Lcom/shinobicontrols/charts/SChartGLDrawer

#2

Hi aderington,

It sounds like an obfuscation issue here - I take it you’re running your app through Proguard for the release build (and not doing so for the debug build)?

The simple solution is to make sure in your Proguard config you don’t obfuscate any of our library. Just add the following to your config file:

-libraryjars libs/shinobicharts-android-trial-1.4.1.jar
-keep class com.shinobicontrols.** { *; }    

This information wasn’t actually in our User Guide so my apologies for that but we’ve made sure it’ll be in there for our next release.

Kind regards,

Patrick


#3

That worked, thank you!


#4

I’ve gotten farther, but now I get an NPE from Shinobi.

Stack Trace

_________________________________

0java.lang.NullPointerException

1at com.shinobicontrols.charts.NumberAxis.a(SourceFile:311)

2at com.shinobicontrols.charts.cs.e(SourceFile:195)

3at com.shinobicontrols.charts.cs.d(SourceFile:146)

4at com.shinobicontrols.charts.cs.a(SourceFile:50)

5at com.shinobicontrols.charts.Axis.a(SourceFile:2114)

6at com.shinobicontrols.charts.x.a(SourceFile:214)

7at com.shinobicontrols.charts.t.onDraw(SourceFile:54)

8at android.view.View.draw(View.java:15393)

9at com.shinobicontrols.charts.t.draw(SourceFile:64)

10at android.view.View.getDisplayList(View.java:14287)

11at android.view.View.getDisplayList(View.java:14329)

12at android.view.View.draw(View.java:15107)

13at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

14at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

15at com.shinobicontrols.charts.x.dispatchDraw(SourceFile:100)

16at android.view.View.getDisplayList(View.java:14282)

17at android.view.View.getDisplayList(View.java:14329)

18at android.view.View.draw(View.java:15107)

19at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

20at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

21at android.view.View.draw(View.java:15396)

22at android.view.View.getDisplayList(View.java:14287)

23at android.view.View.getDisplayList(View.java:14329)

24at android.view.View.draw(View.java:15107)

25at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

26at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

27at android.view.View.getDisplayList(View.java:14282)

28at android.view.View.getDisplayList(View.java:14329)

29at android.view.View.draw(View.java:15107)

30at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

31at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

32at android.view.View.draw(View.java:15396)

33at android.view.View.getDisplayList(View.java:14287)

34at android.view.View.getDisplayList(View.java:14329)

35at android.view.View.draw(View.java:15107)

36at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

37at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

38at android.view.View.getDisplayList(View.java:14282)

39at android.view.View.getDisplayList(View.java:14329)

40at android.view.View.draw(View.java:15107)

41at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

42at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

43at android.view.View.getDisplayList(View.java:14282)

44at android.view.View.getDisplayList(View.java:14329)

45at android.view.View.draw(View.java:15107)

46at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

47at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

48at android.view.View.getDisplayList(View.java:14282)

49at android.view.View.getDisplayList(View.java:14329)

50at android.view.View.draw(View.java:15107)

51at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

52at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

53at android.view.View.draw(View.java:15396)

54at android.widget.FrameLayout.draw(FrameLayout.java:472)

55at android.widget.ScrollView.draw(ScrollView.java:2184)

56at android.view.View.getDisplayList(View.java:14287)

57at android.view.View.getDisplayList(View.java:14329)

58at android.view.View.draw(View.java:15107)

59at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

60at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

61at android.view.View.draw(View.java:15396)

62at android.view.View.getDisplayList(View.java:14287)

63at android.view.View.getDisplayList(View.java:14329)

64at android.view.View.draw(View.java:15107)

65at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

66at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

67at android.view.View.getDisplayList(View.java:14282)

68at android.view.View.getDisplayList(View.java:14329)

69at android.view.View.draw(View.java:15107)

70at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

71at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

72at android.view.View.draw(View.java:15396)

73at android.support.v4.view.ViewPager.draw(ViewPager.java:2171)

74at android.view.View.getDisplayList(View.java:14287)

75at android.view.View.getDisplayList(View.java:14329)

76at android.view.View.draw(View.java:15107)

77at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

78at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

79at android.view.View.getDisplayList(View.java:14282)

80at android.view.View.getDisplayList(View.java:14329)

81at android.view.View.draw(View.java:15107)

82at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

83at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

84at android.view.View.getDisplayList(View.java:14282)

85at android.view.View.getDisplayList(View.java:14329)

86at android.view.View.draw(View.java:15107)

87at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

88at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

89at android.view.View.getDisplayList(View.java:14282)

90at android.view.View.getDisplayList(View.java:14329)

91at android.view.View.draw(View.java:15107)

92at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

93at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

94at android.view.View.getDisplayList(View.java:14282)

95at android.view.View.getDisplayList(View.java:14329)

96at android.view.View.draw(View.java:15107)

97at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

98at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

99at android.view.View.draw(View.java:15396)

100at com.android.internal.widget.ActionBarOverlayLayout.draw(ActionBarOverlayLayout.java:466)

101at android.view.View.getDisplayList(View.java:14287)

102at android.view.View.getDisplayList(View.java:14329)

103at android.view.View.draw(View.java:15107)

104at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

105at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

106at com.slidingmenu.lib.a.dispatchDraw(CustomViewAbove.java:810)

107at android.view.View.draw(View.java:15396)

108at android.view.View.getDisplayList(View.java:14287)

109at android.view.View.getDisplayList(View.java:14329)

110at android.view.View.draw(View.java:15107)

111at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

112at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

113at android.view.View.getDisplayList(View.java:14282)

114at android.view.View.getDisplayList(View.java:14329)

115at android.view.View.draw(View.java:15107)

116at android.view.ViewGroup.drawChild(ViewGroup.java:3310)

117at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3147)

118at android.view.View.draw(View.java:15396)

119at android.widget.FrameLayout.draw(FrameLayout.java:472)

120at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2583)

121at android.view.View.getDisplayList(View.java:14287)

122at android.view.View.getDisplayList(View.java:14329)

123at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1570)

124at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1449)

125at android.view.ViewRootImpl.draw(ViewRootImpl.java:2751)

126at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2617)

127at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2185)

128at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)

129at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6567)

130at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)

131at android.view.Choreographer.doCallbacks(Choreographer.java:603)

132at android.view.Choreographer.doFrame(Choreographer.java:573)

133at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)

134at android.os.Handler.handleCallback(Handler.java:733)

135at android.os.Handler.dispatchMessage(Handler.java:95)

136at android.os.Looper.loop(Looper.java:136)

137at android.app.ActivityThread.main(ActivityThread.java:5476)

138at java.lang.reflect.Method.invokeNative(Native Method)

139at java.lang.reflect.Method.invoke(Method.java:515)

140at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)

141at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)

142at dalvik.system.NativeStart.main(Native Method)

Could you please take a look?


#5

Hi aderington,

Glad to hear you got the obfuscation issue sorted.

The NullPointer error sounds like a separate thing and seems to be related to where the TickMarks are being generated. Is it only happening in the release build or is the exception being thrown in the debug build as well?

Would it be possible to send us a sample project that exhibits the same behaviour so we can look into it further? If you could email it to info@shinobicontrols.com that would be great.

Kind regards,

Patrick


#6

Unfortunately I have not been able to reproduce the crash. I can tell you the scenario though.

I was on an Activity with 5 fragments, each with a ChartView in it.  The charts had not all populated yet (still getting back the data from our servers)

I switched to another Activity that had a ChartFragment in it and that’s when it crashed.  Hopefully that helps.


#7

Hello aderington,

Thank you for your enquiry. 

I notice that you are using a ChartView object in your application. May I please ask; have you included code to pass through all of the lifecycle callbacks (such as onCreate()) from the activity to the ChartView object(s)? 

For reference please see the api docs for the ChartView object at the link below:

http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.4.1/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/ChartView.html

In particular I’d like to draw your attention to the class overview section at the top of this document.

If you could please let us know if you have implemented this code, we should be able to look into this further for you.

In the meantime, if you have any further queries please get in touch.

Thanks,

Kai.