I saw that CM13 is out and it brings Android 6.0.1 (r17) goodies such as the battery saving ‘doze’ functionality and new permissions model, alongside the usual set of CM features. I have an HTC m8 sitting around which I figure was due for a custom rom right about now, so I downloaded and install a copy of CM 13 from https://get.cm. everything went well as expected. I downloaded a copy of google apps from opengapps and installed it next and thats where things took a turn for the worse, as soon as I booted into CM i started getting errors of setup wizard being force closed over and over. I couldnt do anything but click the OK button over and over. So if you are getting a Cyanogenmod Gapps error this just may help you.
I booted into TWRP and tried fixing permission with no luck on next boot into system. I tried re-flashing everything from a clean install again with same results. I saw that you could report the issue so I clicked the submit button and it let me see the actual error that was being thrown which looked partially like :
AndroidRuntime: java.lang.RuntimeException: Unable to create application com.google.android.setupwizard.SetupWizardApplication: java.lang.SecurityException: addOnSubscriptionsChangedListener: Neither user 10069 nor current process has android.permission.READ_PHONE_STATE.
luckily I had enabled debugging before I installed gapps. so I connected my phone to my computer, booted up ADB, check out my post on some basic ADB commands here if you need a refresher, and granted the permissions needed for the issue to be resolved!
I checked for connected device :
which gave me :
List of devices attached
I then ran commands on my phone by connected to the shell on it and running my grant command:
adb -s FA43XXXXXXXX shell pm grant com.google.android.setupwizard android.permission.READ_PHONE_STATE
it gave no output and looked like this :
C:\Users\sumguy\adb>adb -s FA43XXXXXXXX shell
shell@m8:/ $ pm grant com.google.android.setupwizard android.permission.READ_PHONE_STATE
This can be adapted for other such error also:
pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION
this seems to have resolved the issue for me and I was able to login to my account normally now with no crashes so far.