New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NoSuchMethodException: setActivityController #66
Comments
Can you share more info about your setup? What kind of emulator are you using? And what version of Test Butler? |
I've seen this before. You aren't using Gradle 3.5 are you? If so, try Gradle 3.4.1. You can find out the version by looking at |
I'd be curious to know how Gradle version could cause this. We've used Test Butler with Gradle 3.5 as well as Gradle 4.0 without any issues. |
Ignore that last suggestion, sorry. Sounds like a mismatch of test butler versions on the emulator and the library version used in
|
I'm using nexus 5x . I tried run on emulator nexus 6p then it's ok. I don't know why. |
I've been able to use it fine on a Nexus 5X API 25 emulator fine. Not sure what's different. What api level was the Nexus 5X and Nexus 6P at? Were they different? |
I don't know but when I run on nexus 5x with API 25 then I have to fix code with two params. I run on simulator 6P API 23 then I don't have to fix code. |
Quick question: Do the emulators come with Google APIs (e.g. Google maps, etc)? |
yeah, it has Google APIs |
OK, try using an emulator image API 25 without Google APIs. |
I tried run with API 25 without Google APIs and it's ok. Don't need to fix code . |
Cool. But I am running tests on API 25 with Google APIs on my machine. It's bizarre why it's not working on your machine. Does it manage to do some tests and then fails on one test or does the build fail setting up tests? |
Is there a workaround without compiling test butler myself? Are there any other google api emulators i could use? |
Can your demo invoke setActivityController successfully ? As I know system will check if the caller has permission <android.permission.SET_ACTIVITY_WATCHER>. If no, it will fail to invoke. Unfortunately the permission is HIDE and system app use only. Is it possilbe to invoke it on 3rd party app? |
I see the same issue using Test Butler 1.3.1, Pixel Emulator, API 25 w/ Google APIs. I've verified that the apk and library versions match. I don't see a system image in sdkmanager for API 25 without Google APIs. This issue occurs both on setup and teardown. Stack trace:
I am also unable to install the test butler APK on API 24 or 26. @Kisty which revision of the API 25 Google APIs system image are you using? I am using the latest, which is 11 |
The fix for this has been merged, I'll do a new release sometime this week. |
Hi All,
I have issue when run code . My error :
Failed to install custom IActivityController: setActivityController [interface android.app.IActivityController]
java.lang.NoSuchMethodException: setActivityController [interface android.app.IActivityController]
at java.lang.Class.getMethod(Class.java:1981)
at java.lang.Class.getDeclaredMethod(Class.java:1960)
error at method :
private static void setActivityController(@nullable IActivityController activityController) {
try {
Class<?> amClass = Class.forName("android.app.ActivityManagerNative");
Method getDefault = amClass.getMethod("getDefault");
Object am = getDefault.invoke(null);
Log.d(TAG, "setActivityController: " + am.getClass());
Method setMethod = am.getClass().getDeclaredMethod("setActivityController", new Class[]{IActivityController.class});
setMethod.invoke(am, activityController);
} catch (Throwable e) {
Log.e(TAG, "Failed to install custom IActivityController: " + e.getMessage(), e);
}
}
Can you tell me how to fix this error ?
The text was updated successfully, but these errors were encountered: