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.

permissionsBuilder .sendSuspend() not completing first time

See original GitHub issue

Description

Using version 3.2.0, after given Location Permissions, sendSuspend() doesn’t return, in other words, my app freezes the UI (it doesn’t get rendered because it needs location permission and since sendSuspend() doesn’t complete I can’t query result.allGranted() and proceed with logic.
If I navigate back and then forward it works (the permission wore granted and no pop-up is shown, I can query result.allGranted() happily and carry on).

If I downgrade to 3.1.3 it works as expected.


KPermissions version: 3.2.0

API level: SDK 30, Google Pixel 3a Android 11

How to reproduce it: Clear app cache and run it so that permissions are prompt again.

Sample code:

lifecycleScope.launchWhenResumed {
    val result =
    permissionsBuilder(Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION).build().sendSuspend()
    if (result.allGranted()) { ... }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:31 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
GuilhEcommented, Mar 19, 2021

It’s fixed!

1reaction
fondesacommented, Mar 19, 2021

@GuilhE Can you try the version 3.2.1 and check that the bug is fixed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly pause app until permission request is finished?
Put the code inside your //More UI preparation stuff to a new method. After the permissions, say ' init() ' private void init(){...
Read more >
Send Emails with SendGrid API using Micronaut with Kotlin ...
It suspends the coroutine for a specific time. Suspending a coroutine does not block the underlying thread, but allows other coroutines to run ......
Read more >
Request app permissions - Android Developers
In certain situations, the permission might be denied automatically, without the user taking any action. (A permission might be granted automatically as well.) ......
Read more >
Create an IAM user and assume a role with Amazon STS ...
The following code examples show how to: Create a user who has no permissions. Create a role that grants permission to list Amazon...
Read more >
Apache Kafka Reference Guide - Quarkus
SmallRye Reactive Messaging processes records asynchronously, so offsets may be committed for records that have been polled but not yet processed. In case...
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