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.

"Give permissions" dialog in Nearby activity keeps flickering

See original GitHub issue

Summary:

“Give permissions” dialog in Nearby activity keeps flickering. You cannot select the “give permissions” option while it is doing that, and eventually it crashes.

This problem seems to occur in master branch. Actually, I’m testing PR #1672 , but that is based on master at the time of my testing, and that PR is unlikely to be the cause since there is no relevant change in that PR. I haven’t had that issue the last time I tested master, so it is likely to be a change in the last few weeks or so (or alternatively, it could be caused by my phone’s recent update to Android 8.0.0). After this, I will test with an emulator on Android 7.0, and also test 2.8-release branch to see if that has the same problem.

Steps to reproduce:

  • Turn off location permissions for the app
  • Load Nearby

Add System logs:

On “warning”, because there is too much nonsense in “debug”

06-29 02:48:24.511 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:26.981 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:27.095 21978-21978/fr.free.nrw.commons.debug E/ViewRootImpl: sendUserActionEvent() returned.
06-29 02:48:27.178 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:27.327 21978-21978/fr.free.nrw.commons.debug E/ViewRootImpl: sendUserActionEvent() returned.
06-29 02:48:27.393 21978-21978/fr.free.nrw.commons.debug W/Activity: Can reqeust only one set of permissions at a time
06-29 02:48:27.590 21978-21978/fr.free.nrw.commons.debug E/ViewRootImpl: sendUserActionEvent() returned.
06-29 02:48:32.851 3642-4133/? E/SamsungWindowManager: prepareAddWindowLw - exceeded windows limit 40 < 41  win=Window{e7d9d3 u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity}
06-29 02:48:32.857 21978-21978/fr.free.nrw.commons.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: fr.free.nrw.commons.debug, PID: 21978
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=1, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@24fa3cd has already been added
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4491)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4534)
        at android.app.ActivityThread.-wrap20(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1752)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
     Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@24fa3cd has already been added
        at android.view.ViewRootImpl.setView(ViewRootImpl.java:966)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:381)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:100)
        at android.app.Dialog.show(Dialog.java:420)
        at fr.free.nrw.commons.nearby.NearbyActivity.showLocationPermissionDeniedErrorDialog(NearbyActivity.java:254)
        at fr.free.nrw.commons.nearby.NearbyActivity.onRequestPermissionsResult(NearbyActivity.java:229)
        at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7728)
        at android.app.Activity.dispatchActivityResult(Activity.java:7551)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4487)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4534) 
        at android.app.ActivityThread.-wrap20(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1752) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6944) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 
06-29 02:48:32.862 3642-4133/? W/ActivityManager: crash : fr.free.nrw.commons.debug,0
06-29 02:48:32.863 3642-4133/? W/ActivityManager:   Force finishing activity fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity
06-29 02:48:32.868 3642-4133/? W/ActivityManager:   Force finishing activity fr.free.nrw.commons.debug/fr.free.nrw.commons.contributions.ContributionsActivity
06-29 02:48:32.869 3642-4133/? W/MultiScreenManagerService: moveTaskBackToDisplayIfNeeded(): root activity or app is null, task=TaskRecord{aef1e0ed0 #11801 A=fr.free.nrw.commons.debug U=0 StackId=1 sz=34}, rootActivity=null
06-29 02:48:33.025 21893-21905/? W/PkgUtils: p: fr.free.nrw.commons.debug, u:0
06-29 02:48:33.365 3642-3664/? W/ActivityManager: Activity pause timeout for ActivityRecord{62232ce u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity t11801 f}
06-29 02:48:42.874 3642-3664/? W/ActivityManager: Activity destroy timeout for ActivityRecord{f105487 u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.contributions.ContributionsActivity t11801 f}
06-29 02:48:43.801 3642-3664/? W/ActivityManager: Activity destroy timeout for ActivityRecord{62232ce u0 fr.free.nrw.commons.debug/fr.free.nrw.commons.nearby.NearbyActivity t11801 f}

Device and Android version:

Samsung Galaxy S7 Android 8.0.0

Commons app version:

#1672

Would you like to work on the issue?

Preferably not…

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
VaishSiddharthcommented, Jul 10, 2018

Ok I will send the pull request for this issue. And report other issues also.

0reactions
misaochancommented, Jul 10, 2018

Do you mean that you would like to submit fixes for the other issues at the same time, too? Sure, by all means, feel free to submit multiple PRs, assuming there aren’t any requested changes outstanding on your original PR. We have been having a bit of a backlog with PR reviews, so it’s totally fine to have multiple PRs open at the same time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid Flickering on a dialog that moves its controls on resize
When user re-sizes the dialog, some of the controls in the dialog should be re-positioned (not re-sized). It also involves re-sizing of the ......
Read more >
Display issues in Office client applications. - Microsoft Learn
Your screen flickers or flashes. An Office program is either mostly all white or all black. Text in your document is not displayed...
Read more >
How to Fix the Most Annoying Things in Windows - PCMag
Prevent it from ever happening by hitting the Shift five times rapidly to bring up that very dialog box (or in Windows 10...
Read more >
Outlook needs password but dialog box disappears
In Windows, go to Settings -> Accounts -> Access work or school, see if your account is listed there, other than the AD...
Read more >
Troubleshooting a Flickering Display after a Windows 10 ... - Dell
The flickering issue can be caused due to a software compatibility issue or the video driver. Resolution. The first step is to determine...
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