Android Question Duplicate declarations of android.permission.WRITE_EXTERNAL_STORAGE with different maxSdkVersions

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Hi,
I have upgrade an app from SDK 23 to 26 and I am now getting the error

Upload failed
Duplicate declarations of permission android.permission.WRITE_EXTERNAL_STORAGE with different maxSdkVersions.

when I upload to the App store.

I have checked other messages on the site, which seem to suggest that it is because of DirExternal, but I have changed all of my calls to use GetSafeDirDefaultExternal.

I have added the following lines into the Manifest file as recommended when using getSafeDirDefaultExternal:
B4X:
'************ Fallback when using GetSafeDirDefaultExternal ********

AddManifestText(
<uses-permission
  android:name="android.permission.WRITE_EXTERNAL_STORAGE"
  android:maxSdkVersion="18" />
)

'***********  Fallback when using GetSafeDirDefaultExternal (end) ********

When I check using the List Permissions button, the only reference to WRITE_EXTERNAL_STORAGE comes in the MapFragment object, which the app also uses.

2 Questions:

  1. Is it safe to just remove the fallback lines from the manifest file in this case as the Map fragement forces the use of WRITE_EXTERNAL_STORAGE.
  2. Should I be adding code to CheckandRequest(PERMISSION_WRITE_EXTERNAL_STORAGE) to the code. It seems to be working ok without this but I don't want to run into problems in live.
Thanks for your help
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…