java.lang.NullPointerException

JIRA | Dong Jun | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Reproduce Test Steps ==================== Enable lzma support: run gyp_xwalk --use_lzma=1 build XWalkCoreShell.apk. Expected Outcome ================ Not crash. Actual Outcome ============== Crashed. Test Case Source Code ===================== Test Builds =========== Issue Analysis ============== in org.xwalk.core.XWalkPreferences.setValue(XWalkPreferences.java:107) this rely on coreWrapper, which will be initialized after lzma decompressed. So the solution is place XWalkViewShellActivity.setContentView in onXWalkReady. call sequence: XWalkViewShellActivity.setContentView -> XWalkViewSectionFragment.onCreate -> XWalkViewSectionFragment.onCreateView -> XWalkViewShellActivity.onXWalkViewCreated -> XWalkPreferences.setValue (coreWrapper is null) crash stack: D/XWalkActivity( 1342): Reserve object: class org.xwalk.core.XWalkView D/XWalkActivity( 1342): Reserve object: class org.xwalk.core.xwview.shell.XWalkViewShellActivity$11 D/XWalkActivity( 1342): Reserve method: setResourceClient D/XWalkActivity( 1342): Reserve object: class org.xwalk.core.xwview.shell.XWalkViewShellActivity$12 D/XWalkActivity( 1342): Reserve method: setUIClient D/AndroidRuntime( 1342): Shutting down VM W/dalvikvm( 1342): threadid=1: thread exiting with uncaught exception (group=0xb1b0eba8) E/AndroidRuntime( 1342): FATAL EXCEPTION: main E/AndroidRuntime( 1342): Process: org.xwalk.core.xwview.shell, PID: 1342 E/AndroidRuntime( 1342): java.lang.NullPointerException E/AndroidRuntime( 1342): at org.xwalk.core.XWalkPreferences.setValue(XWalkPreferences.java:107) E/AndroidRuntime( 1342): at org.xwalk.core.xwview.shell.XWalkViewShellActivity.onXWalkViewCreated(XWalkViewShellActivity.java:367) E/AndroidRuntime( 1342): at org.xwalk.core.xwview.shell.XWalkViewSectionFragment.onCreateView(XWalkViewSectionFragment.java:42) E/AndroidRuntime( 1342): at android.app.Fragment.performCreateView(Fragment.java:1700) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062) E/AndroidRuntime( 1342): at android.app.BackStackRecord.run(BackStackRecord.java:684) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479) E/AndroidRuntime( 1342): at android.support.v13.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:145) E/AndroidRuntime( 1342): at android.support.v4.view.ViewPager.populate(ViewPager.java:1073) E/AndroidRuntime( 1342): at android.support.v4.view.ViewPager.populate(ViewPager.java:919) E/AndroidRuntime( 1342): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) E/AndroidRuntime( 1342): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) E/AndroidRuntime( 1342): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) E/AndroidRuntime( 1342): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/AndroidRuntime( 1342): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) E/AndroidRuntime( 1342): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/AndroidRuntime( 1342): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/AndroidRuntime( 1342): at android.view.Choreographer.doFrame(Choreographer.java:544) E/AndroidRuntime( 1342): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/AndroidRuntime( 1342): at android.os.Handler.handleCallback(Handler.java:733) E/AndroidRuntime( 1342): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 1342): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime( 1342): at android.app.ActivityThread.main(ActivityThread.java:5017) E/AndroidRuntime( 1342): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 1342): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime( 1342): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) E/AndroidRuntime( 1342): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) E/AndroidRuntime( 1342): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 376): Force finishing activity org.xwalk.core.xwview.shell/.XWalkViewShellActivity

    JIRA | 2 years ago | Dong Jun
    java.lang.NullPointerException
  2. 0

    Reproduce Test Steps ==================== Enable lzma support: run gyp_xwalk --use_lzma=1 build XWalkCoreShell.apk. Expected Outcome ================ Not crash. Actual Outcome ============== Crashed. Test Case Source Code ===================== Test Builds =========== Issue Analysis ============== in org.xwalk.core.XWalkPreferences.setValue(XWalkPreferences.java:107) this rely on coreWrapper, which will be initialized after lzma decompressed. So the solution is place XWalkViewShellActivity.setContentView in onXWalkReady. call sequence: XWalkViewShellActivity.setContentView -> XWalkViewSectionFragment.onCreate -> XWalkViewSectionFragment.onCreateView -> XWalkViewShellActivity.onXWalkViewCreated -> XWalkPreferences.setValue (coreWrapper is null) crash stack: D/XWalkActivity( 1342): Reserve object: class org.xwalk.core.XWalkView D/XWalkActivity( 1342): Reserve object: class org.xwalk.core.xwview.shell.XWalkViewShellActivity$11 D/XWalkActivity( 1342): Reserve method: setResourceClient D/XWalkActivity( 1342): Reserve object: class org.xwalk.core.xwview.shell.XWalkViewShellActivity$12 D/XWalkActivity( 1342): Reserve method: setUIClient D/AndroidRuntime( 1342): Shutting down VM W/dalvikvm( 1342): threadid=1: thread exiting with uncaught exception (group=0xb1b0eba8) E/AndroidRuntime( 1342): FATAL EXCEPTION: main E/AndroidRuntime( 1342): Process: org.xwalk.core.xwview.shell, PID: 1342 E/AndroidRuntime( 1342): java.lang.NullPointerException E/AndroidRuntime( 1342): at org.xwalk.core.XWalkPreferences.setValue(XWalkPreferences.java:107) E/AndroidRuntime( 1342): at org.xwalk.core.xwview.shell.XWalkViewShellActivity.onXWalkViewCreated(XWalkViewShellActivity.java:367) E/AndroidRuntime( 1342): at org.xwalk.core.xwview.shell.XWalkViewSectionFragment.onCreateView(XWalkViewSectionFragment.java:42) E/AndroidRuntime( 1342): at android.app.Fragment.performCreateView(Fragment.java:1700) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062) E/AndroidRuntime( 1342): at android.app.BackStackRecord.run(BackStackRecord.java:684) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447) E/AndroidRuntime( 1342): at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479) E/AndroidRuntime( 1342): at android.support.v13.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:145) E/AndroidRuntime( 1342): at android.support.v4.view.ViewPager.populate(ViewPager.java:1073) E/AndroidRuntime( 1342): at android.support.v4.view.ViewPager.populate(ViewPager.java:919) E/AndroidRuntime( 1342): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) E/AndroidRuntime( 1342): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) E/AndroidRuntime( 1342): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) E/AndroidRuntime( 1342): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) E/AndroidRuntime( 1342): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291) E/AndroidRuntime( 1342): at android.view.View.measure(View.java:16497) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295) E/AndroidRuntime( 1342): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/AndroidRuntime( 1342): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) E/AndroidRuntime( 1342): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/AndroidRuntime( 1342): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/AndroidRuntime( 1342): at android.view.Choreographer.doFrame(Choreographer.java:544) E/AndroidRuntime( 1342): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/AndroidRuntime( 1342): at android.os.Handler.handleCallback(Handler.java:733) E/AndroidRuntime( 1342): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 1342): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime( 1342): at android.app.ActivityThread.main(ActivityThread.java:5017) E/AndroidRuntime( 1342): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 1342): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime( 1342): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) E/AndroidRuntime( 1342): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) E/AndroidRuntime( 1342): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 376): Force finishing activity org.xwalk.core.xwview.shell/.XWalkViewShellActivity

    JIRA | 2 years ago | Dong Jun
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.xwalk.core.XWalkPreferences.setValue()
    2. org.xwalk.core
      XWalkViewSectionFragment.onCreateView
      1. org.xwalk.core.XWalkPreferences.setValue(XWalkPreferences.java:107)
      2. org.xwalk.core.xwview.shell.XWalkViewShellActivity.onXWalkViewCreated(XWalkViewShellActivity.java:367)
      3. org.xwalk.core.xwview.shell.XWalkViewSectionFragment.onCreateView(XWalkViewSectionFragment.java:42)
      3 frames
    3. Android Platform
      FragmentManagerImpl.executePendingTransactions
      1. android.app.Fragment.performCreateView(Fragment.java:1700)
      2. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
      3. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
      4. android.app.BackStackRecord.run(BackStackRecord.java:684)
      5. android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
      6. android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:479)
      6 frames
    4. android-support-v13
      FragmentPagerAdapter.finishUpdate
      1. android.support.v13.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:145)
      1 frame
    5. Android Support v4
      ViewPager.onMeasure
      1. android.support.v4.view.ViewPager.populate(ViewPager.java:1073)
      2. android.support.v4.view.ViewPager.populate(ViewPager.java:919)
      3. android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441)
      3 frames
    6. Android Platform
      ViewGroup.measureChildWithMargins
      1. android.view.View.measure(View.java:16497)
      2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
      3. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
      4. android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
      5. android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
      6. android.view.View.measure(View.java:16497)
      7. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
      8. android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
      9. android.view.View.measure(View.java:16497)
      10. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
      10 frames
    7. Android
      ActionBarOverlayLayout.onMeasure
      1. com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327)
      1 frame
    8. Android Platform
      FrameLayout.onMeasure
      1. android.view.View.measure(View.java:16497)
      2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
      3. android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
      3 frames
    9. Android
      PhoneWindow$DecorView.onMeasure
      1. com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291)
      1 frame
    10. Android Platform
      ActivityThread.main
      1. android.view.View.measure(View.java:16497)
      2. android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916)
      3. android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113)
      4. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295)
      5. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
      6. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
      7. android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
      8. android.view.Choreographer.doCallbacks(Choreographer.java:574)
      9. android.view.Choreographer.doFrame(Choreographer.java:544)
      10. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
      11. android.os.Handler.handleCallback(Handler.java:733)
      12. android.os.Handler.dispatchMessage(Handler.java:95)
      13. android.os.Looper.loop(Looper.java:136)
      14. android.app.ActivityThread.main(ActivityThread.java:5017)
      14 frames
    11. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:515)
      2 frames
    12. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
      2 frames
    13. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame