Android 10 Permission Crashing
powerpoint45 opened this issue · comments
In Android 10 the app crashes when using library with the following error:
2020-05-24 22:47:55.759 14083-14083/com.powerpoint45.dtube E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.powerpoint45.dtube, PID: 14083
java.lang.RuntimeException: Unable to start service io.hamed.floatinglayout.FloatingLayoutService@762835b with Intent { cmp=com.powerpoint45.dtube/io.hamed.floatinglayout.FloatingLayoutService (has extras) }: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@bad026a -- permission denied for window type 2038
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4105)
at android.app.ActivityThread.access$1800(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@bad026a -- permission denied for window type 2038
at android.view.ViewRootImpl.setView(ViewRootImpl.java:955)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:387)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95)
at io.hamed.floatinglayout.FloatingLayoutService.createView(FloatingLayoutService.kt:98)
at io.hamed.floatinglayout.FloatingLayoutService.onStart(FloatingLayoutService.kt:61)
at android.app.Service.onStartCommand(Service.java:503)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4087)
This might help solve the issue: https://stackoverflow.com/questions/46208897/android-permission-denied-for-window-type-2038-using-type-application-overlay
fixed