question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android O permission denied for window type 2006

See original GitHub issue

06-19 22:18:06.485 27339-27339/com.example.mateen.gcmtesting E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.mateen.gcmtesting, PID: 27339 java.lang.RuntimeException: Unable to start service com.example.mateen.gcmtesting.ActionServices.CameraService@edc3f43 with Intent { cmp=com.example.mateen.gcmtesting/.ActionServices.CameraService (has extras) }: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@8da1cf2 -- permission denied for window type 2006 at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3556) at android.app.ActivityThread.-wrap20(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@8da1cf2 -- permission denied for window type 2006 at android.view.ViewRootImpl.setView(ViewRootImpl.java:788) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:92) at com.androidhiddencamera.HiddenCameraService.addPreView(HiddenCameraService.java:125) at com.androidhiddencamera.HiddenCameraService.startCamera(HiddenCameraService.java:82) at com.example.mateen.gcmtesting.ActionServices.CameraService.onStartCommand(CameraService.java:100) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3539) at android.app.ActivityThread.-wrap20(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6541)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

this error comes when i call the service to take the picture in android O

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
Mateeencommented, Jun 22, 2017

i have found the solution there need to change only one Flag which android O deprecated you may can appreciate me later 😛 change your flag Windomanger flag “TYPE_SYSTEM_OVERLAY” to “TYPE_APPLICATION_OVERLAY” please make these changes in your project to make compatible with upcoming android O

1reaction
kevalpatel2106commented, Jun 22, 2017

@Mateeen Thank you. I will change this and update this in upcoming release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to add window. Permission denied for this window type
This means that only Apps signed with the same certificate as the creator of the permission can use it. The creator of android.permission....
Read more >
Fix "permission denied for this window type" when adding ...
The problem is the new android permission system. To get rid of this error, you must request the new permissions from the user....
Read more >
Request app permissions - Android Developers
Android provides several ways to reset unused runtime permissions to their default, denied state: An API where you can proactively remove your app's...
Read more >
Unable to add window android.view.ViewRootImpl$W ... - 博客园
ViewRootImpl$W@6518342 -- permission denied for window type 2133 ... to add window " + mWindow + " -- another window of type "...
Read more >
[Solved]-Unable to add window android.view.ViewRootImpl
Coding example for the question Unable to add window android.view.ViewRootImpl -- permission denied for window type 2006. RN v.0.44-React Native.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found