Android Question Google Play Upload Failure

PaulusPaulus

Member
Licensed User
Longtime User
Hi Erel

Just upgraded to v9.

I have an app that produces an apk nicely. It relies heavily on saving text files to File.DirRootExternal and File.DirDefaultExternal.

I have done some checking, especially https://www.b4x.com/android/forum/t...roid-permission-write_external_storage.90457/

Every time I try to upload to google play console I get the error mentioned above. ie:


"Upload failed

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


Your app currently targets API level 23 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 26. Learn how."


My manifest begins:


"AddManifestText(

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="23"/>

<uses-permission

android:name="android.permission.WRITE_EXTERNAL_STORAGE"

android:maxSdkVersion="18" />"


Do you have any suggestions please how to overcome this?

Thanks.
 

JohnC

Expert
Licensed User
Longtime User
You need to change the targetSDK in your manifest from the "23" that you have now to at least "26" as the Google message says.

Before:

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="23"/>

After:

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="26"/>
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

PaulusPaulus

Member
Licensed User
Longtime User
Thanks.
Android jar is version 28.
Tried tip but apk installed but doesn't run and does not upload to play console... :(

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="26"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />"
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You shouldn't limit your questions to a single member.

Android jar is version 28.
This has nothing to do with targetSdkVersion. See the tutorial.

Duplicate declarations of permission android.permission.WRITE_EXTERNAL_STORAGE with different maxSdkVersions.
Remove this snippet:
B4X:
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />"
It is not needed as your app adds the external storage permission for all version.
 
Upvote 0
Top