39

On the devices which have installed the latest update of Android Marshmallow - that is June2016 update, when I ask for permissions, the ALLOW button is not working.

I have tested with these 2 devices:

Nexus 6p (Andoid version - 6.0.1, Build number - MTC19V)

Nexus 7 (Android version 6.0.1, Build number - MOB30M)

Both have the latest update, and when I request permissions, the dialog is shown, but I'm not able to press the ALLOW button.

Here is the code, that I use to request permissions:

public void showPermissionsDialog() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        int hasWriteExternalStoragePermission = activity.checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
        int hasWriteGetAccountsPermission = activity.checkSelfPermission(android.Manifest.permission.GET_ACCOUNTS);

        if (hasWriteExternalStoragePermission != PackageManager.PERMISSION_GRANTED || hasWriteGetAccountsPermission != PackageManager.PERMISSION_GRANTED) {
            activity.requestPermissions(new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE, android.Manifest.permission.GET_ACCOUNTS}, MainActivity.REQUEST_CODE_ASK_PERMISSIONS);
        } else {
            isAllPermissionsGranted = true;
        }
    } else {
        isAllPermissionsGranted = true;
    }

}



    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        if (requestCode == REQUEST_CODE_ASK_PERMISSIONS) {
            if (grantResults.length > 0) {
                boolean isAllPermissionsGranted = true;
                for (int i = 0; i < grantResults.length; i++) {
                    if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
                        isAllPermissionsGranted = false;
                    }
                }

                if (isAllPermissionsGranted) {
                    this.isAllPermissionsGranted = true;
                } else {
                    android.widget.Toast.makeText(this, "Please, grand permissions", android.widget.Toast.LENGTH_LONG).show();
                    showPermissionsDialog();
                }
            }
        }
    }

Any suggestions on how to fix this? Thanks in advance!

EDIT

Here is the bug report to Google. We're still waiting for the fix from Google.

EDIT 1

This issue has been fixed!

Helen Hakobyan
  • 734
  • 1
  • 8
  • 18
  • did u override onRequestPermissionsResult ?? – Jagjit Singh Jun 15 '16 at 08:23
  • yes, of course...I'll add the code – Helen Hakobyan Jun 15 '16 at 08:59
  • I just updated the OS, till morning the same set of code was working fine and after the update am not to click the allow button. Do let me know if you find any solution? – Vivek C A Jun 15 '16 at 09:22
  • @Vivek I will surely. So far, I have found this https://code.google.com/p/android/issues/detail?id=213120 – Helen Hakobyan Jun 15 '16 at 11:42
  • @hakobyanheghine I think someone in the Android team screw it up.... I am having the same issue, the allow button stop working and the same code it have been working for moths and continue to work in previos version... I just update my nexus 6 this morning and now is not working xD – Javier Vieira Jun 15 '16 at 12:36
  • further more, I have download some apps like the official reddit app and after this update, is not working the runtime permissions xD – Javier Vieira Jun 15 '16 at 13:30
  • Same happened to me, any idea when google is going to fix this? – Recaldev Jun 15 '16 at 13:51
  • Hi, i have also update my nexus and got same issue, can any one found a solution? – Cheerag Jun 15 '16 at 16:08
  • @JavierVieira completely agree, they screwed up big this time :D – Helen Hakobyan Jun 15 '16 at 16:19
  • @Dullahan we are still waiting for response from Google, but if you need your app to work for testing, here is the workaround: "Workaround" go to settings --> apps -> look for the app --> permissions --> add the permissions manually – Helen Hakobyan Jun 15 '16 at 16:22
  • happening in MIUI 7.5.1.0-Android 6.0.1,even rebooting pause it just for some days,again issue get started – Shreekant N Aug 17 '16 at 07:55

5 Answers5

55

EDIT: It has been marked as a defect in the last android and it will be fix in a future release of the OS. Bug report

EDIT 2: File manager email me that they fix this feature in their app. I have not try File Manager anymore, but if you update the app it should not give you this problem anymore. But basically this behavior, could be from any app doing overlay in a wrong way until android fix it.

I finally got it (at least in my case)... its the f**** File Manager app's service. If its service is stopped, the permissions work again.

https://play.google.com/store/apps/details?id=com.rhmsoft.fm

I had this app before the update to "MOB30M" and the runtime permissions where working without a problem (is my daily job to program this) and i have been using the file manager to put the release APK inside the phone and run it to install the APK. So is not some app that I installed today.

What I fund awful is that one app can make crash all the permission system.

It's and overly problem

I understand that the permission system is not being crashed, since an app could be used to falsify the dialogs, BUT shouldn’t then Android (Google) tell you that you have an app that is running on the top and that if you want to give permissions to the app you should uninstall XXXX app? I mean for the sake of the User Experience.

A normal user, would think that his phone is broken and probably would send the phone back to google or the carrier xD

Come on, let's be honest, cant android make this better? Is not like you need your phone rooted to have this behavior (my phone is not rooted). If you dont inform the user what's going on, then is like is broken

Javier Vieira
  • 2,100
  • 20
  • 23
  • wow, thank you, i did that and it worked, but like you said it is very awful a single app can do this xD – Recaldev Jun 15 '16 at 19:16
  • 1
    @JavierVieira I have just tried and it works! Thank you! Hopefully Google will fix this issue before my app goes live xD – Helen Hakobyan Jun 16 '16 at 07:43
  • They probably will do it soon and probably they will also stop updating more people with this version...mainly because also Google apps are affected as well as all apps compiled with SDK 23 – Javier Vieira Jun 16 '16 at 08:33
  • Can overlay get above permission dialog and be used to replace "allow" and "deny" with over the top images? – Qi Fan Jul 04 '16 at 00:31
2

In my case Clean Master's iSwipe was causing this issue, Disable ISWIPE feature in their settings

Ujju
  • 2,723
  • 3
  • 25
  • 35
1

Its android marshmallow 6.0.1 issue. As per Google support, they are working on this issue https://code.google.com/p/android/issues/detail?id=213120

Kimmi Dhingra
  • 2,249
  • 22
  • 21
0

I was about to report the same issue but here it is already registered,i am facing this since 2 months, no idea why but the 'Allow' button doesnt work in my NEXUS 6P phone also. It seems this problem is only running in the nexus series

@Google and android team : Please fix this,its really annoying as to how many times we are facing this issue i mean for each app ,one needs to keep going to setting for the workaround for manually setting permissions.

Its really a silly bug :/

-2

Uninstalled File Manager and downloaded it again, "Allow" button suddenly works again.

Josh
  • 5,631
  • 1
  • 28
  • 54
KimmyS
  • 9
  • 2
    Well not a valid answer...it works because when you uninstall the service stops....if you install again then the service is not running until you open the app again...as soon. As you do that the service of the app starts running again f***** up the permission system again. Also it could be that is not because of file manager....it could be any app doing overlay. Ot has officially been marked as a defect in the last update of Android and will be fix by the Android team – Javier Vieira Jun 16 '16 at 04:40
  • I agree with @JavierVieira, uninstall can't be a solution because doesn't solve entirely the problem, we have to wait for the next security patch from google. – Recaldev Jun 20 '16 at 19:12