Hi,
I have an XF application that targets Android 11 (min 9, target 11).
I have set up the request of permission for external storage like this (following this post on stackoverflow 66366102):
if (DeviceInfo.Version.Major >= 11)
{
bool okReadWrite11 = Android.OS.Environment.IsExternalStorageManager;
if (!okReadWrite11)
{
Intent intent = new Intent(Android.Provider.Settings.ActionManageAppAllFilesAccessPermission);
intent.AddCategory("android.intent.category.DEFAULT");
intent.SetData(Android.Net.Uri.Parse(string.Format("package:{0}", AppInfo.PackageName)));
StartActivityForResult(intent, 2296);
}
[....]
and my AndroidManifest.xml is this one:
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<application android:label="XXX" android:icon="@mipmap/my_icon" android:requestLegacyExternalStorage="true" android:networkSecurityConfig="@XML /network_security_config">
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@XML /file_paths"></meta-data>
</provider>
</application>
<queries>
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
</intent>
</queries>
when I try to get picture from folder or try to get a picture from the camera this error is trigger:
then I have tried to remove from androidManifest:
android:maxSdkVersion="28"
but this new error is trigger (after I have response "Yes" to the question "allow app XX access to video...."):
I don't know how to make this works :(
EDIT:
this is the file_paths.xml:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="FileImportati" path="/FileImportati" />
<external-files-path name="FileAllegati" path="/FileAllegati" />
<external-files-path name="ReportGenerati" path="/ReportGenerati" />
<!--debug-->
<external-path name="ALLEGATI" path="Android/data/it.volos.myApp/ALLEGATI" />
<!--release-->
<!--<external-path name="ALLEGATI" path="data/user/0/it.volos.myApp/files/ALLEGATI" />-->
</paths>