-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Cannot Get External Storage Permissions with Android Custom Build Enabled #60635
Comments
Note that Android 11 and later have a scoped storage requirement, so you probably need to include #51815 in a custom build. (This has been a pain point for all application developers lately, not just Godot.) |
Thank you! - I've compiled that build of Godot. I haven't manually compiled Godot before, so I'm wondering where I should source my Export Templates from? |
You need to build your own export templates from the same branch as the one you used to compile the editor. See Compiling for Android for instructions. |
Thanks for helping with a topic that you've seen before with others, I appreciate it. - Compiling that build of Godot fixed the issue! |
It might be worth leaving this issue open, although we could consolidate this with #48636. |
Ah, ok! I'll leave it open for now, then, |
Godot version
3.4.4 Stable
System information
Windows 10, Installing on Android 12.
Issue description
When using the Android permissions READ_EXTERNAL_STORAGE and/or WRITE_EXTERNAL_STORAGE, these permissions are unable to be prompted for, or granted when using a custom Android build.
When using no custom build, with Write External Storage and Read External Storage enabled under the Android Export permissions section, running
OS.request_permissions()
successfully prompts for the storage permissions, and granting them works perfectly as well.However, when using a custom build, with the same permissions checked under the Android Export permissions section, running
OS.request_permissions()
doesn't prompt for the storage permissions, and these storage permissions also do not show under the App Info>Permissions section in Android's settings. Even when manually adding<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
to the custom build's AndroidManifest.xml file, these permissions seemingly cannot be prompted for, or manually granted under App Info.
As a comparison, enabling and prompting for (using
OS.request_permissions()
) "Read SMS" (android.permision.READ_SMS
in the .xml file) successfully prompts, and enables the SMS permissions, even with Android Custom Build enabled, suggesting this issue is only regarding External Storage permissions.Steps to reproduce
Using the Minimal Reproduction project (which is simply a project with a single button, and "blank"/stock Android custom build template installed), here's how you can replicate this behaviour:
Be sure to install an Android Build Template, as it was too large to include in the attatched .zip!
Disable
Use Custom Build
in the Android Export menu.Make sure Read External Storage and Write External Storage are checked under the export "Permissions" section.
Enable another permission, such as Read SMS, to be prompted for.
Export/Deploy the project onto an Android device. Clicking the button should successfully prompt for both the Storage and SMS permissions.
Uninstall the application from your Android device, so all permissions get revoked.
Then:
Enable
Use Custom Build
in the Android Export menu.Verify Read External Storage and Write External Storage are checked.
Verify an additional permission, such as Read SMS, is checked.
Export/Deploy the project onto an Android device. Clicking the button should successfully prompt for the SMS permission, but not the Storage permissions.
Manually adding or removing storage permission tags to the custom build's AndroidManifest.xml file should not have any effect on whether these permissions are prompted for, or seen under App Info.
Minimal reproduction project
AndroidPermissionTest.zip
The text was updated successfully, but these errors were encountered: