1

On program execution, I get the error message:

FATAL EXCEPTION: main E/AndroidRuntime( 2977): java.lang.NullPointerException.

The bottom messages gives only a small hint to the self written source code. But there is missing a detailed information to the line number of incorrect code. Which possibilities exist to get a log output with more specific information to the root reason of the exception? In this question I don't like to know what is the mistake in the code. My question is:

What is to be done to detect the mistake of code himself?

For example, can more information be queried with the android debug manager? Or what other possibilities exist? It is javac command line programming. Android Studio shall not be used. I hope the basic options of debug solution should be independent of the use of using an IDE or not.

For the current example, here is the log output:

D/AndroidRuntime( 2977): Shutting down VM
W/dalvikvm( 2977): threadid=1: thread exiting with uncaught exception (group=0xa5000678)
E/AndroidRuntime( 2977): FATAL EXCEPTION: main
E/AndroidRuntime( 2977): java.lang.NullPointerException
E/AndroidRuntime( 2977): at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:1764)
E/AndroidRuntime( 2977): at android.view.View.measure(View.java:15848)
E/AndroidRuntime( 2977): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:728)
E/AndroidRuntime( 2977): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)
E/AndroidRuntime( 2977): at android.view.View.measure(View.java:15848)
E/AndroidRuntime( 2977): at android.support.v7.widget.RecyclerView$LayoutManager.measureChildWithMargins(RecyclerView.java:5555)
E/AndroidRuntime( 2977): at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1332)
E/AndroidRuntime( 2977): at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1269)
E/AndroidRuntime( 2977): at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:523)
E/AndroidRuntime( 2977): at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:1988)
E/AndroidRuntime( 2977): at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2237)
E/AndroidRuntime( 2977): at android.view.View.layout(View.java:14289)
E/AndroidRuntime( 2977): at android.view.ViewGroup.layout(ViewGroup.java:4562)
E/AndroidRuntime( 2977): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
E/AndroidRuntime( 2977): at android.view.View.layout(View.java:14289)
E/AndroidRuntime( 2977): at android.view.ViewGroup.layout(ViewGroup.java:4562)
E/AndroidRuntime( 2977): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
E/AndroidRuntime( 2977): at android.view.View.layout(View.java:14289)
E/AndroidRuntime( 2977): at android.view.ViewGroup.layout(ViewGroup.java:4562)
E/AndroidRuntime( 2977): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
E/AndroidRuntime( 2977): at android.view.View.layout(View.java:14289)
E/AndroidRuntime( 2977): at android.view.ViewGroup.layout(ViewGroup.java:4562)
E/AndroidRuntime( 2977): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
E/AndroidRuntime( 2977): at android.view.View.layout(View.java:14289)
E/AndroidRuntime( 2977): at android.view.ViewGroup.layout(ViewGroup.java:4562)
E/AndroidRuntime( 2977): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1976)
E/AndroidRuntime( 2977): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1730)
E/AndroidRuntime( 2977): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
E/AndroidRuntime( 2977): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
E/AndroidRuntime( 2977): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
E/AndroidRuntime( 2977): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
E/AndroidRuntime( 2977): at android.view.Choreographer.doFrame(Choreographer.java:532)
E/AndroidRuntime( 2977): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
E/AndroidRuntime( 2977): at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime( 2977): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 2977): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2977): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime( 2977): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2977): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 2977): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime( 2977): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 2977): at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 2977): GC_CONCURRENT freed 206K, 26% free 2638K/3556K, paused 2ms+1ms, total 10ms
W/ActivityManager( 1448):   Force finishing activity com.mypackage/.PopupWindow
I/WindowManager( 1448): Screenshot max retries 4 of Token{a592d048 ActivityRecord{a56d4960 u0 com.mypackage/.PopupWindow}} appWin=Window{a5503378 u0 com.mypackage/com.mypackage.PopupWindow} drawState=1
W/WindowManager( 1448): Screenshot failure taking screenshot for (1080x1920) to layer 21015
gotwo
  • 663
  • 8
  • 16
  • Also please take look into similar exception posts https://stackoverflow.com/questions/28179494/cause-for-nullpointerexception-android-support-v7-widget-recyclerview-onmeasure – Volodymyr Bereziuk Feb 12 '20 at 12:15

0 Answers0