dtmilano / CulebraTester2-public

CulebraTester: Snaky Android Testing
Apache License 2.0
139 stars 29 forks source link

Error starting accessibility service #25

Closed nathan-lamy closed 3 months ago

nathan-lamy commented 3 months ago

Hi ! Thank you for this tool, it's amazing :)) I have successfully installed the APKs of the latest version on a new device (they don't need any permissions, is this normal??) When I try to launch the server, I face this issue :

🐍 Starting CulebraTester2-public service...
INSTRUMENTATION_STATUS: class=com.dtmilano.android.culebratester2.UiAutomatorHelper
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.dtmilano.android.culebratester2.UiAutomatorHelper:
INSTRUMENTATION_STATUS: test=uiAutomatorHelper
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: class=com.dtmilano.android.culebratester2.UiAutomatorHelper
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stack=java.lang.IllegalStateException: UiAutomationService android.accessibilityservice.IAccessibilityServiceClient$Stub$Proxy@c8fc885already registered!
        at android.os.Parcel.createException(Parcel.java:2079)
        at android.os.Parcel.readException(Parcel.java:2039)
        at android.os.Parcel.readException(Parcel.java:1987)
        at android.app.IUiAutomationConnection$Stub$Proxy.connect(IUiAutomationConnection.java:427)
        at android.app.UiAutomation.connect(UiAutomation.java:241)
        at android.app.Instrumentation.getUiAutomation(Instrumentation.java:2167)
        at androidx.test.uiautomator.UiDevice.getUiAutomation(UiDevice.java:1129)
        at androidx.test.uiautomator.QueryController.<init>(QueryController.java:95)
        at androidx.test.uiautomator.UiDevice.<init>(UiDevice.java:109)
        at androidx.test.uiautomator.UiDevice.getInstance(UiDevice.java:261)
        at com.dtmilano.android.culebratester2.UiAutomatorHelper.setUp(UiAutomatorHelper.kt:37)

INSTRUMENTATION_STATUS: stream=
Error in uiAutomatorHelper(com.dtmilano.android.culebratester2.UiAutomatorHelper):
java.lang.IllegalStateException: UiAutomationService android.accessibilityservice.IAccessibilityServiceClient$Stub$Proxy@c8fc885already registered!
        at android.os.Parcel.createException(Parcel.java:2079)
        at android.os.Parcel.readException(Parcel.java:2039)
        at android.os.Parcel.readException(Parcel.java:1987)
        at android.app.IUiAutomationConnection$Stub$Proxy.connect(IUiAutomationConnection.java:427)
        at android.app.UiAutomation.connect(UiAutomation.java:241)
        at android.app.Instrumentation.getUiAutomation(Instrumentation.java:2167)
        at androidx.test.uiautomator.UiDevice.getUiAutomation(UiDevice.java:1129)
        at androidx.test.uiautomator.QueryController.<init>(QueryController.java:95)
        at androidx.test.uiautomator.UiDevice.<init>(UiDevice.java:109)
        at androidx.test.uiautomator.UiDevice.getInstance(UiDevice.java:261)
        at com.dtmilano.android.culebratester2.UiAutomatorHelper.setUp(UiAutomatorHelper.kt:37)

INSTRUMENTATION_STATUS: test=uiAutomatorHelper
INSTRUMENTATION_STATUS_CODE: -2
INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

Do you have any idea? or need further logs? Thank you in advance!

nathan-lamy commented 3 months ago

After searching more and more, I found that : https://blog.csdn.net/sunzhimin1991/article/details/108600079 The problem was that I had an incompatible version of uiatomator installed on the device. After uninstalling it, everything work fine!

dtmilano commented 3 months ago

Cool. The other common problem is having another app that's using accessibility services at the same time.