Skip to content
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

StfAgent doesn't run on Android S DP3 #37

Closed
pcrepieux opened this issue May 7, 2021 · 8 comments
Closed

StfAgent doesn't run on Android S DP3 #37

pcrepieux opened this issue May 7, 2021 · 8 comments
Assignees

Comments

@pcrepieux
Copy link

Here is the stacktrace showing that a method called through reflection doesn't exist anymore.

04-30 09:24:54.906 31651 31651 D AndroidRuntime: Calling main entry jp.co.cyberagent.stf.Agent
04-30 09:24:54.911 31651 31667 I MinitouchAgent: creating socket minitouchagent
04-30 09:24:54.911 31651 31667 I MinitouchAgent: Listening on minitouchagent
04-30 09:24:54.912 31651 31668 E AndroidRuntime: FATAL EXCEPTION: Thread-2
04-30 09:24:54.912 31651 31668 E AndroidRuntime: PID: 31651
04-30 09:24:54.912 31651 31668 E AndroidRuntime: java.lang.UnsupportedOperationException: UserActivityWakeInjector is not supported
04-30 09:24:54.912 31651 31668 E AndroidRuntime: at jp.co.cyberagent.stf.compat.PowerManagerWrapper$OldUserActivityWakeInjector.<init>(PowerManagerWrapper.java:121)
04-30 09:24:54.912 31651 31668 E AndroidRuntime: at jp.co.cyberagent.stf.compat.PowerManagerWrapper.<init>(PowerManagerWrapper.java:26)
04-30 09:24:54.912 31651 31668 E AndroidRuntime: at jp.co.cyberagent.stf.Agent.run(Agent.java:124)
04-30 09:24:54.914  1644  2676 I DropBoxManagerService: add tag=system_server_crash isTagEnabled=true flags=0x2
04-30 09:24:54.915 31651 31668 I Process : Sending signal. PID: 31651 SIG: 9
@Chadarr
Copy link

Chadarr commented May 31, 2021

Compiled APK with these changes
STFService is finally able to start, device is shown as ready to use in STF web console

But when I start using device, another crash happens

05-31 16:18:58.655  8312  8339 W .cyberagent.st: Accessing hidden method Landroid/view/IWindowManager$Stub$Proxy;->getDefaultDisplayRotation()I (max-target-o, reflection, denied)
05-31 16:18:58.655  8312  8339 W .cyberagent.st: Accessing hidden method Landroid/view/IWindowManager;->getDefaultDisplayRotation()I (max-target-o, reflection, denied)
05-31 16:18:58.655  8312  8339 W System.err: java.lang.NoSuchMethodException: android.view.IWindowManager$Stub$Proxy.getRotation []
05-31 16:18:58.655  8312  8339 W System.err: 	at java.lang.Class.getMethod(Class.java:2103)
05-31 16:18:58.655  8312  8339 W System.err: 	at java.lang.Class.getMethod(Class.java:1724)
05-31 16:18:58.656  8312  8339 W System.err: 	at jp.co.cyberagent.stf.compat.WindowManagerWrapper.getRotation(WindowManagerWrapper.java:65)
05-31 16:18:58.656  8312  8339 W System.err: 	at jp.co.cyberagent.stf.monitor.RotationMonitor.peek(RotationMonitor.java:54)
05-31 16:18:58.656  8312  8339 W System.err: 	at jp.co.cyberagent.stf.Service$Server$Connection.run(Service.java:369)
05-31 16:18:58.656  8312  8339 W System.err: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
05-31 16:18:58.656  8312  8339 W System.err: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-31 16:18:58.656  8312  8339 W System.err: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-31 16:18:58.656  8312  8339 W System.err: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-31 16:18:58.656  8312  8339 W System.err: 	at java.lang.Thread.run(Thread.java:920)

@pcrepieux
Copy link
Author

@Chadarr, could you provide more logs, I am not sure this error can cause a crash.

@Chadarr
Copy link

Chadarr commented Jun 8, 2021

Reproduced aforementioned crash this morning, please find whole logcat attached
pixel12.log

@pcrepieux
Copy link
Author

Thanks for the log @Chadarr
I think your issue is related to minicap :
06-08 11:25:03.766 20287 20287 F linker : CANNOT LINK EXECUTABLE "/data/local/tmp/minicap": cannot locate symbol "_ZN7android21SurfaceComposerClient23getPhysicalDisplayTokenEm" referenced by "/data/local/tmp/minicap.so"...
It's been fixed with DeviceFarmer/stf#262

@sudhalucky
Copy link

sudhalucky commented Jun 21, 2021

Hi @pcrepieux , I am able to get it working on Android 12 however when I rotate the screen to landscape in STF the screen resolution stays in portrait and the device screen of landscape is skewed to portrait resolution and scaled instead of rendering it in Landscape resolution.
Note: Other devices Pixel and non Pixel on Android-11 and below work fine as expected, this is only happening on Pixel with Android-12, can you please help?

Portrait Screenshot:

portrait-android-12

Landscape Screenshot:

landscape-android-12

@pcrepieux
Copy link
Author

@sudhalucky,
Indeed I also noticed it. That's more likely an issue with https://github.com/DeviceFarmer/minicap.
I am on it.

@sudhalucky
Copy link

HI @pcrepieux How are you? Were you able to get this sorted. Let me know if I can try something on my side if you are busy.

@pcrepieux
Copy link
Author

Currently testing the fix for proper rotation handling. Will push the updated code shortly (please refer to DeviceFarmer/minicap#17)

As the initial issue is already fixed (#42) and the other one mentioned in this thread doesn't seems related (DeviceFarmer/stf#262), let's close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants