Android Question Google Play Upload Failure

Discussion in 'Android Questions' started by PaulusPaulus, Jun 6, 2019.

  1. PaulusPaulus

    PaulusPaulus Member Licensed 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.
     
  2. JohnC

    JohnC Well-Known Member Licensed 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"/>
     
  3. DonManfred

    DonManfred Expert Licensed User

  4. PaulusPaulus

    PaulusPaulus Member Licensed 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" />"
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    You shouldn't limit your questions to a single member.

    This has nothing to do with targetSdkVersion. See the tutorial.

    Remove this snippet:
    Code:
    <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.
     
  6. PaulusPaulus

    PaulusPaulus Member Licensed User

    Thanks all. Will try :)
     
  7. PaulusPaulus

    PaulusPaulus Member Licensed User

    The manifest snippet removal and targetSdkVersion change worked!
    Thank you so much :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice