Freitag, 3. Januar 2014

Android graphview Library and Proguard

android graphview

If you are using GraphView inside your Android apps, make sure to exclude it from being obfuscated by your proguard config.
I recently changed my app Battery Temperature Guard. I do not use AndroidPlot anymore as a diagram. Instead I use Graphview. Its a cool library to quickly build scaleable and scrollable diagrams.

Everything worked great, but after I released my apps I noticed that scaling by pinch & zoom did not work anymore.
Logcat showed the logs below. By adding this simple line to my proguard.cfg I managed to exclude the graphview classes and packages from being obfuscated by proguard.

-keep class com.jjoe64.graphview.** { *; }


01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.view.Choreographer.doCallbacks(Choreographer.java:574)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.view.Choreographer.doFrame(Choreographer.java:542)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:733)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.os.Looper.loop(Looper.java:136)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5017)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
01-03 18:16:17.015    7626-7626/? W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
01-03 18:16:17.025    7626-7626/? W/System.err﹕ java.lang.NullPointerException: null receiver
01-03 18:16:17.025    7626-7626/? W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
01-03 18:16:17.025    7626-7626/? W/System.err﹕ at com.jjoe64.graphview.a.b.a(SourceFile:91)
01-03 18:16:17.025    7626-7626/? W/System.err﹕ at com.jjoe64.graphview.c.onTouchEvent(SourceFile:199)
01-03 18:16:17.025    7626-7626/? W/System.err﹕ at android.view.View.dispatchTouchEvent(View.java:7706)
01-03 18:16:17.025    7626-7626/? W/System.err﹕ at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
01-03 18:16:17.025    7626-7626/? W/System.err﹕ at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1959)
01-03 18:16:17.025    7626-7626/? W/System.err﹕ at android.v

Keine Kommentare:

Kommentar veröffentlichen