openatx / android-uiautomator-server

MIT License
252 stars 145 forks source link

Android 9 FOREGROUND_SERVICE permission fix #29

Closed NathanKun closed 5 years ago

NathanKun commented 5 years ago

I've got a 'java.lang.SecurityException: Permission Denial: startForeground' when launching the app on my Pixel 2 XL Android 9.

Since Android9 Apps wanting to use foreground services must now request the FOREGROUND_SERVICE permission first. This is a normal permission, so the system automatically grants it to the requesting app. Starting a foreground service without the permission throws a SecurityException.

So I added the permission and the app works now.

codeskyblue commented 5 years ago

Thanks