java.lang.NullPointerException

JIRA | 朱杰 | 1 year 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

    Impacted Cases ============== {code} java.lang.NullPointerException at org.xwalk.core.internal.XWalkSettingsInternal$EventHandler.access$600(XWalkSettingsInternal.java:100) at org.xwalk.core.internal.XWalkSettingsInternal.setAllowFileAccessFromFileURLs(XWalkSettingsInternal.java:371) at com.yoren.canon.MainActivity.onXWalkReady(MainActivity.java:81) at org.xwalk.core.XWalkActivity$2.run(XWalkActivity.java:122) at org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:179) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:303) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:266) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5117) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) {code} Reproduce Test Steps ==================== run... Expected Outcome ================ .setAllowFileAccessFromFileURLs(true); .setAllowUniversalAccessFromFileURLs(true); Actual Outcome ============== crash Test Case Source Code ===================== {code} XWalkView web_view = (XWalkView) findViewById(R.id.login_web_view); {code} . . . {code} @Override protected void onXWalkReady() { try { Method ___getBridge = XWalkView.class.getDeclaredMethod("getBridge"); ___getBridge.setAccessible(true); XWalkViewBridge xWalkViewBridge = null; xWalkViewBridge = (XWalkViewBridge) ___getBridge.invoke(web_view); XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true); //17.46.448.4 crash here ↓ xWalkViewBridge.getSettings().setAllowFileAccessFromFileURLs(true); xWalkViewBridge.getSettings().setAllowUniversalAccessFromFileURLs(true); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } web_view.load(url, null); } {code} Test Builds =========== Issue Analysis ==============

    JIRA | 1 year ago | 朱杰
    java.lang.NullPointerException
  2. 0

    Impacted Cases ============== {code} java.lang.NullPointerException at org.xwalk.core.internal.XWalkSettingsInternal$EventHandler.access$600(XWalkSettingsInternal.java:100) at org.xwalk.core.internal.XWalkSettingsInternal.setAllowFileAccessFromFileURLs(XWalkSettingsInternal.java:371) at com.yoren.canon.MainActivity.onXWalkReady(MainActivity.java:81) at org.xwalk.core.XWalkActivity$2.run(XWalkActivity.java:122) at org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:179) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:303) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:266) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5117) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) {code} Reproduce Test Steps ==================== run... Expected Outcome ================ .setAllowFileAccessFromFileURLs(true); .setAllowUniversalAccessFromFileURLs(true); Actual Outcome ============== crash Test Case Source Code ===================== {code} XWalkView web_view = (XWalkView) findViewById(R.id.login_web_view); {code} . . . {code} @Override protected void onXWalkReady() { try { Method ___getBridge = XWalkView.class.getDeclaredMethod("getBridge"); ___getBridge.setAccessible(true); XWalkViewBridge xWalkViewBridge = null; xWalkViewBridge = (XWalkViewBridge) ___getBridge.invoke(web_view); XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true); //17.46.448.4 crash here ↓ xWalkViewBridge.getSettings().setAllowFileAccessFromFileURLs(true); xWalkViewBridge.getSettings().setAllowUniversalAccessFromFileURLs(true); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } web_view.load(url, null); } {code} Test Builds =========== Issue Analysis ==============

    JIRA | 1 year ago | 朱杰
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.xwalk.core.internal.XWalkSettingsInternal$EventHandler.access$600()
    2. org.xwalk.core
      XWalkSettingsInternal.setAllowFileAccessFromFileURLs
      1. org.xwalk.core.internal.XWalkSettingsInternal$EventHandler.access$600(XWalkSettingsInternal.java:100)
      2. org.xwalk.core.internal.XWalkSettingsInternal.setAllowFileAccessFromFileURLs(XWalkSettingsInternal.java:371)
      2 frames
    3. com.yoren.canon
      MainActivity.onXWalkReady
      1. com.yoren.canon.MainActivity.onXWalkReady(MainActivity.java:81)
      1 frame
    4. org.xwalk.core
      XWalkLibraryLoader$ActivateTask.onPostExecute
      1. org.xwalk.core.XWalkActivity$2.run(XWalkActivity.java:122)
      2. org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:179)
      3. org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:303)
      4. org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:266)
      4 frames
    5. Android Platform
      ActivityThread.main
      1. android.os.AsyncTask.finish(AsyncTask.java:632)
      2. android.os.AsyncTask.access$600(AsyncTask.java:177)
      3. android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
      4. android.os.Handler.dispatchMessage(Handler.java:102)
      5. android.os.Looper.loop(Looper.java:136)
      6. android.app.ActivityThread.main(ActivityThread.java:5117)
      6 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:515)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
      2 frames
    8. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame