java.lang.NullPointerException

Stack Overflow | O_O | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    UiDevice.getInstance(getInstrumentation()) Crashes (as Null object reference) when Launching the Instrumentation using startInstrumentation()

    Stack Overflow | 2 years ago | gau
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.UiAutomation.setOnAccessibilityEventListener(android.app.UiAutomation$OnAccessibilityEventListener)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at android.support.test.uiautomator.UiAutomatorBridge.setOnAccessibilityEventListener()
    2. android.support.test
      UiDevice.getInstance
      1. android.support.test.uiautomator.UiAutomatorBridge.setOnAccessibilityEventListener(UiAutomatorBridge.java:78)
      2. android.support.test.uiautomator.QueryController.<init>(QueryController.java:58)
      3. android.support.test.uiautomator.UiAutomatorBridge.<init>(UiAutomatorBridge.java:66)
      4. android.support.test.uiautomator.InstrumentationUiAutomatorBridge.<init>(InstrumentationUiAutomatorBridge.java:35)
      5. android.support.test.uiautomator.UiDevice.<init>(UiDevice.java:106)
      6. android.support.test.uiautomator.UiDevice.getInstance(UiDevice.java:269)
      6 frames
    3. myPackageName
      MyTestClass.<init>
      1. myPackageName.MyTestClass.<init>(MyTestClass.java:34)
      1 frame
    4. Java RT
      Constructor.newInstance
      1. java.lang.reflect.Constructor.constructNative(Native Method)
      2. java.lang.reflect.Constructor.newInstance(Constructor.java:417)
      2 frames