Question

I have an app on google play which has flurry diagnostics in. On the flurry website it reports a NullPointerException but I am struggling to work out what section of code it is occurring in.

The program is protected with proguard, but flurry has a system whereby you upload proguard's mapping.txt and it will translate.

The resulting "stack trace" is shown below. I am puzzled the fact that it says "Unknown Source" in relation to set_up_text_trace_for_quiz, and also by the list of five methods immediately below. Where has the null pointer exception occurred? And why does add_game_play_buttons have $2548a35 next to it?

java.lang.NullPointerException
com.mycompany.mygame.DEF_GamePlay.set_up_text_trace_for_quiz(Unknown Source)
                             start_up_game_mode
                             distxyxy
                             do_move
                             add_game_play_buttons$2548a35
                             tpl
com.mycompany.mygame.DEF_GamePlay$MicksSurfaceViewExtension.onTouchEvent(Unknown Source)
android.view.View.dispatchTouchEvent(View.java:7340)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2185)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1928)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2185)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1928)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2185)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1928)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2185)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1928)
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2113)
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1466)
android.app.Activity.dispatchTouchEvent(Activity.java:2468)
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2061)
android.view.View.dispatchPointerEvent(View.java:7525)
android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3368)
android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3300)
android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4392)
android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4370)
android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4474)
android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163)
android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4442)
android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4493)
android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
android.view.Choreographer.doCallbacks(Choreographer.java:555)
android.view.Choreographer.doFrame(Choreographer.java:523)
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
android.os.Handler.handleCallback(Handler.java:615)
android.os.Handler.dispatchMessage(Handler.java:92)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:4895)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
dalvik.system.NativeStart.main(Native Method)
Was it helpful?

Solution

Looking at the output, it is likely that your ProGuard configuration file is missing the following lines:

-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

Please take a look at another post here for some more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top