当我在 Android Studio 中运行 UIAutomator 时,有时会出现崩溃。
W/ActivityManager: Crash of app com.example.testsample running instrumentation ComponentInfo{com.example.testsample.test/android.support.test.runner.AndroidJUnitRunner}
07-16 19:19:34.191 7834-7850/? W/Binder: Binder call failed.
java.lang.SecurityException: Calling from not trusted UID!
at android.app.UiAutomationConnection.throwIfCalledByNotTrustedUidLocked(UiAutomationConnection.java:427)
at android.app.UiAutomationConnection.shutdown(UiAutomationConnection.java:324)
at android.app.IUiAutomationConnection$Stub.onTransact(IUiAutomationConnection.java:209)
at android.os.Binder.execTransact(Binder.java:570)
但并不是每次都显示。当没有显示时我可以成功运行。
谁能帮我?
谢谢。
private void throwIfCalledByNotTrustedUidLocked() {
final int callingUid = Binder.getCallingUid();
if (callingUid != mOwningUid && mOwningUid != Process.SYSTEM_UID
&& callingUid != 0 /*root*/) {
throw new SecurityException("Calling from not trusted UID!");
}
}
这是抛出错误的方法。也许是uid
与过程不同uid
or the uid
在该设备上不是root
。也许您可以在应用程序中添加一些打印来找出答案。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)