Xamarin.Android: Adjusting legacy storage permissions for Android 13 deployments
23K reputation · 26 Sept 2021, 18:53 UTC
The primary objective is to guarantee that a Xamarin.Android application targeting API level 33 can successfully install and launch on Android 13 devices. The current build process preserves the legacy READ_EXTERNAL_STORAGE permission declared in the app’s manifest, yet Android 13 requires the new READ_MEDIA_IMAGES (and related media permissions) for media access. When the legacy permission is present, the OS rejects the request, causing launch failures or silent crashes, as evidenced by logcat entries such as Permission denied: android.permission.READ_MEDIA_IMAGES.
Constraints include the fact that Xamarin.Android 12.x does not automatically translate deprecated permission names, and no migration guide is published. Developers must decide whether to manually update the manifest or rely on a potential undocumented build flag. The unresolved decision is whether Xamarin should provide automatic mapping of legacy permissions to the new media permission set.
Questions for investigation:
- Does the current Xamarin.Android release automatically map
READ_EXTERNAL_STORAGEto the appropriate media permissions when targeting API level 33? - If automatic mapping is absent, what is the recommended workflow to update the manifest without breaking backward compatibility on lower API levels?
- Is there a build-time flag or configuration that can enable legacy-to-new permission mapping in future Xamarin.Android releases?