Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-136660

Android 11 Scoped Storage is coming.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 1.17.20.23 Beta, 1.17.20.22 Beta, 1.17.10
    • None
    • Unconfirmed
    • Android

      Not resolved yet!

      To Android players:

      1. You don't have to understand the content below the horizontal ruler, but I'm also glad if you understand.
      2. A file migration might happen on your Android device later if your "File Storage Location" is "External".
      3. Pay attention to the official announcement about this incoming migration. You might be advised to backup something.
      4. If beta on your Android 11 device is not working properly anymore, backup your files and set "File Storage Location" to "Application" temporarily. If beta seems still working correctly on your Android 11 device, don't re-install your beta version of Minecraft.

      To developers:
      Meet Google Play's target API level requirement

      Google Play's target API level requirement

      Starting in November 2021, app updates will be required to target API level 30 or above and adjust for behavioral changes in Android 11.

      I know this isn't a typical bug. This is a technical issue with a potential privacy issue. I will give my resolution. Considering this suggestion will be outdated after November, I've decided to post it here.
      Not that all of players on the Feedback website know about app development. I don't expect players to vote for a suggestion they don‘t even understand.
      Without enough votes, it's impossible for this suggestion to be watched by the developers before November.

      The Play Store is starting to require app updates to target Android 11 in November.
      Starting in November, updates of Minecraft have to target API level 30 or the Play Store will not accept.
      To readers don't know about API level: If apps target to a new API level, they have to behave as if they are installed on the correct Android version, regardless of the current Android version the user is using.

      The behavior changes of Android 11 include the scoped storage enforcement. Storage updates in Android 11

      Scoped storage enforcement

      Access into external storage directories is limited to an app-specific directory.

      Obviously, the directory "/sdcard/games" that Minecraft uses when "File Storage Location" is "External" is beyond the app-specific directory of Minecraft. Minecraft that targets API level 30 is losing the permissions for that directory, which could result in disappearance of currently imported worlds, resource packs and behavior packs and disability to create any world, which has happened in 1.17.30.20 Beta on my Android 11 device!
      MCPE-137652

      Of course, apps that target API level 30 can still ask for read and write permissions for any specific directory using the SAF Picker. However, on various modified Android OSs, the Picker doesn't always work. For example, on MIUI, the Picker doesn't have full privileges, which is different from other AOSP powered OSs. There are many other disadvantages, but I don't want to go into details. It can only be a plan B.

      Q. E. D.

      My resolution:

      Minecraft on Android is supposed to migrate files to a new directory inside of "/sdcard/Android/data/com.mojang.minecraftpe"(the correct directory for "external files" on Android 11).

      Steps:

      1. Release a new version that targets API level 29. Let players do not uninstall before step 2. In this version, migration is not necessary but recommended. With android:requestLegacyExternalStorage="true", Minecraft can get the permission for the file migration.
      2. Release a new version that targets API level 30. With android:preserveLegacyExternalStorage="true", Minecraft can keep the permission for the file migration temporarily. Migration must be done.
      3. Repeat step 1 and step 2. If the player has still skipped step 1, Minecraft doesn't have the permission at this stage. Try asking for the permission using the SAF Picker.

      Note that the destination is private on Android 11. Files will be migrated from a public directory to a private directory. It will be a bit difficult for players to access their worlds, resource packs and behavior packs in the filesystem directly after the migration.

      Precautions:

      1. Have migration tested in beta before adding it into release.
      2. Inform Android players of the full details of the incoming migration as soon. Players have the right to get informed.
      3. The old directory is "/sdcard/games/com.mojang". Minecraft is supposed to migrate the "com.mojang" folder only, because there could be other app(s) still using the "games" folder. Only when the folder is empty, Minecraft will be supposed to delete it.
      4. The new directory will be deleted when uninstalling.
      5. Any first install of Minecraft could be a re-install.
      6. Considering the new directory is private, an "Export World" button should be provided to players, and add-on developers affected need new FAQs.

        1. bug.jpg
          2.17 MB
          Worldwidebrine

            Worldwidebrine Worldwidebrine
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: