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.

Google Play is flagging the GET_TASKS permission as an error in the pre-launch report when supporting Android 4.4 and below

See original GitHub issue

Hi there! Thanks for this library, it’s helped a lot.

We had to add the GET_TASKS permission as it’s required to use the getRunningTasks() for Android 4.4 and below else it crashes. I don’t think there’s a way to add the permission for only devices running Android 4.4 and below. https://github.com/livefront/bridge/blob/e0c4e6551ba93e877adcf58737168089f0c6c821/bridge/src/main/java/com/livefront/bridge/BridgeDelegate.java#L167

We’re about to publish a release but the Google Play pre-launch report but it’s flagged an error.

Your app is requesting permissions which are used by less than 1% of functionally similar apps:

android.permission.GET_TASKS Users prefer apps that request fewer permissions and requesting unnecessary permissions can affect your app’s visibility on the Play Store. If these permissions aren’t necessary, you may be able to use alternative methods in your app and request fewer permissions. If they are, we recommend providing an explanation to users of why you need the permissions.

Note: This guidance is based on a comparison with functionally similar apps, which change over time as new apps get published and existing apps change behavior. Therefore the warning may change even if you don’t change your permission usage.

We can explain the reason behind this but it could be a privacy concern for our users.

  1. What’s the GET_TASKS permission for?
  2. Is the GET_TASKS permission necessary?
  3. Is there another way we can do it so to remove the permission?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
byenchocommented, Aug 21, 2020

Hi @Kisty . So this all relates to how Bridge actively clears data on fresh loads of an app. Due to some edge cases, determining a “fresh state” is a bit more complicated than originally intended and we now need to check for running app process data to see if there is only one Activity associated with you app when the check is made. The call to activityManager.getRunningTasks(1) is necessary to do so pre-M.

I agree that it’s unfortunate that you seem to be required to add GET_TASKS to support Android 4.4 and below. I was not aware of that when the PR for that change was merged unfortunately as it is not part of the official documentation. At minimum I would have added a warning to the README, which I will likely do soon now.

The only way I can think of getting around the requirement for most of your users would be to:

  • try to split up your APK into a 4.4-and-under variant that has the flag and another for everyone else. This is definitely a hassle but its possible in theory and Google Play allows it.
  • Skip using Bridge for users 4.4-and-under and call straight to your SavedStateHandler instead. This should work just fine because the crash that Bridge solves wasn’t introduced until Android Nougat anyway.

Let me know if that helps.

0reactions
byenchocommented, Sep 14, 2020

Sure thing 👍 Glad we came up with something acceptable to get around the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understand your pre-launch report - Play Console Help
This article helps you to understand your pre-launch report results by providing an overview of the errors, warnings, or issues your report might...
Read more >
Google Play PreLaunch report - Stack Overflow
Pre-launch report is used to help you find the most common errors just in case you missed them in testing, but it will...
Read more >
Google Play Services and Runtime Permissions
Google Play services automatically obtains all permissions it needs to support its APIs. However, your app should still check and request ...
Read more >
Not able to publish on Google Play / android:exported ...
Hello all, I reaslied today that I can't update my game anymore. The error I get is: "You uploaded an APK or Android...
Read more >
Posts by Richard Haselgrove - BOINC
158) Message boards : Android : Permission for project to download an app? ... system for a while (it's currently on Android 4.4.177-22626479...
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