-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Storage permission is asked in Android 13 and can't be granted #14423
Comments
Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing |
@WhtUsrWrks can you share screenshot of the permission screen and the popup where it is asking permissions? Or better maybe attach a screen recording. |
I have the same issue on my Xiaomi Redmi Note 10 Pro. I have attached a screen recording and written some device info below.
VID_20230913_155251.mp4 |
Thanks for sharing! |
I'm pinning this so we don't forget it |
Hello. |
Nobody mentioned which version of the app are they running. Is the app installed from the app store, downloaded from here etc? |
Version 2.6.15 from the app store. Android 13, pixel 6a |
I could enter, unintentionally. I wanted to show you the gray error message at the bottom and when I hit Delete app data, the app opened. Record_2023-09-19-19-25-11.mp4 |
Could this be the problem?
|
I experience the same running version 2.16.5 on Pixel 7 Pro with Android 13 (September 2023 update) |
Launching AnkiDroid this 09-23 21:21:47.398 18391 19178 I Role : com.ichi2.anki not qualified for android.app.role.HOME due to missing RequiredComponent{mIntentFilterData=IntentFilterData{mAction='android.intent.action.MAIN', mCategories='[android.intent.category.HOME]', mDataScheme='null', mDataType='null'}, mMinTargetSdkVersion=1, mPermission='null', mQueryFlags=0, mMetaData=[]}
09-23 21:21:47.401 18391 19178 I Role : com.ichi2.anki not qualified for android.app.role.DIALER due to missing RequiredComponent{mIntentFilterData=IntentFilterData{mAction='android.intent.action.DIAL', mCategories='[]', mDataScheme='null', mDataType='null'}, mMinTargetSdkVersion=1, mPermission='null', mQueryFlags=0, mMetaData=[]}
09-23 21:21:47.404 18391 18642 I Role : com.ichi2.anki not qualified for android.app.role.SMS due to missing RequiredComponent{mIntentFilterData=IntentFilterData{mAction='android.provider.Telephony.SMS_DELIVER', mCategories='[]', mDataScheme='null', mDataType='null'}, mMinTargetSdkVersion=1, mPermission='android.permission.BROADCAST_SMS', mQueryFlags=0, mMetaData=[]}
09-23 21:21:47.406 20072 20072 E AppInfoDashboard: Package: com.ichi2.anki not found for user: 10
09-23 21:21:47.406 20072 20072 E AppInfoDashboard: Package: com.ichi2.anki not found for user: 11
09-23 21:21:47.407 1494 5310 E AppOps : Bad call made by uid 1000. Package "com.ichi2.anki" does not belong to uid -1.
09-23 21:21:47.407 1494 5310 E AppOps : noteOperation
09-23 21:21:47.407 1494 5310 E AppOps : java.lang.SecurityException: Specified package "com.ichi2.anki" under uid -1 but it is not
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService.verifyAndGetBypass(AppOpsService.java:4703)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService.noteOperationUnchecked(AppOpsService.java:3466)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService.noteOperationImpl(AppOpsService.java:3454)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService.-$$Nest$mnoteOperationImpl(Unknown Source:0)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.lambda$noteOperation$4(AppOpsService.java:7662)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.$r8$lambda$oOwUoG55BBmJ6yiwhp3OAq3tQ30(Unknown Source:0)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher$$ExternalSyntheticLambda3.apply(Unknown Source:32)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.policy.AppOpsPolicy.noteOperation(AppOpsPolicy.java:225)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.noteOperation(AppOpsService.java:7660)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.server.appop.AppOpsService.noteOperation(AppOpsService.java:3438)
09-23 21:21:47.407 1494 5310 E AppOps : at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:479)
09-23 21:21:47.407 1494 5310 E AppOps : at android.os.Binder.execTransactInternal(Binder.java:1309)
09-23 21:21:47.407 1494 5310 E AppOps : at android.os.Binder.execTransact(Binder.java:1268) |
Dear AnkiDroid Team/Users, I experienced the same with AnkiDroid 2.16.5 on Android 13 smartphone.
If I compare this situation to my initial launch of AnkiDroid (blocked by current issue), here is the main difference: First time, I was launching AnkiDroid (2.16.5) after a long period of inactivity (and multiple intermediate AnkiDroid updates), so last time I launched it, it was a version v2.x<2.16 (at that time, grant special access to all files was not yet required). So from my own experience, and only based on it, here are my conclusions on that issue:
Hope this help. Best regards, |
I experienced this as well. Device: Pixel 7 Pro I exhibited the same symptoms as ByteCodeRoad's video, additionally looking under "...->All Permissions" and not finding Storage there either. Deleting app data as per Ezkielnet and then logging back in and syncing solved it. |
@Ezkielnet @gregyski Just to be sure, after tapping the "Get started" in the initial screen, were you actually able to see the deck list screen? (And it was without being asked for any sort of permissions?) (I don't have an Android 13 device so I can't try this way myself.) |
Yes, I can use the application perfectly. I can't be sure if it asks for permissions afterwards because I enabled them manually. |
How nice. Thank you.
Which permission items did you manually enable? |
If I'm understanding the question properly, before the "fix" I'd launch the app and be taken directly to permissions without ever seeing any of the Ankidroid interface. After the "fix", for all practical purposes I was starting with a fresh installation so I had to log in and sync to get my decks back from Ankiweb. I did not, at that time, get asked for any further permissions. Note that I had, when trying to fix the issue originally, manually enabled the "Read and write to the Ankidroid database" permission so that was set as well, so while that had no impact on the original problem, I don't know if it impacted the "fix". Hope that helps. Edit: I just checked my permissions and things again match Ezkielnet. I currently show "No permissions allowed" despite my not actually adjusting them since the "fix". The app is working normally. |
So, after the "Delete app data", the prior manual permissions may be no impact or annulled, and the app works properly without requiring permissions... I think I have a better understanding of the situation. Thank you for the feedbacks. |
A On the local file system, this can be between 20 and 100x slower for basic operations. Listing files can be significantly slower than this (if it works at all). These files do not support random access and can't be passed into any of the standard On the network, the situation is worse. It depends on external providers, and there are known bugs where folder structures are not represented properly and the listing of files is incomplete https://commonsware.com/blog/2019/12/01/scoped-storage-stories-problems-saf.html In my opinion, it is not a safe API which we can use to copy an AnkiDroid collection & media. Especially as a failed transfer would permanently delete user data. On the Play Store, we only support the removed storage permission if a user is using an older version of Android or if a user has upgraded from 2.15 to 2.16. A fresh install from the Play Store does not use any storage permissions on a modern version of Android. This issue occurs because a user did not migrate their storage to the new location when prompted, and Android has revoked their permission to the legacy location. When AnkiDroid had access to the legacy location, it produced backups which can be restored from, BUT: these backups do not include media (we have a huge cohort of users with gigabytes of media) |
Thank you so much for your explanations!
So how come that users don't experience any deleted data with other apps? And what is the long-term plan now? |
Round Sync uses https://github.com/newhinton/Round-Sync/blob/master/app/src/main/AndroidManifest.xml The long term plan is above: #14423 (comment) |
I think that solution is fine in general (#14423 (comment)) We are already nagging people about doing the migration and syncing, I'm not sure what more we can do? The string in your proposed patch could perhaps be less specific about no longer able to access after uninstall and more about "Your collection is in the shared storage area of your device, but we no longer have access to it and Google no longer permits us to request access to it." ...then the other stuff. It could be the system revoked permission, it could be they uninstalled/reinstalled, it could be the user themselves revoked permission... we're not sure why but we don't have permission so the string might be genericized a bit to reflect that |
My patch definitely needs some TLC, I won't have time to bring it through
|
I think it's also capable of using SAF.
Got it 👍 btw I really appreciate your communication to clarify things. 🙏 |
May I know what is the current status of this write external storage issue? |
Hi.. I hadn't used ankidroid so my Samsung Galaxy A21 removed its permissions, and I wanted to use it again today but when I open it it says "Grant storage permission", but I've granted all permissions and it still asks. I've tried u installing and reinstalling and it says the same thing. I don't seem to have a dedicated Storage Permission option in permission manager but it has permission for files and that's on... I don't know what else to change? Thank you
The text was updated successfully, but these errors were encountered: