love2d / love-android

Android build setup for LÖVE.
https://love2d.org
Other
200 stars 70 forks source link

No storage permission on Android 12 (official Löve 11.4 build apk) #239

Closed Zhormos closed 2 years ago

Zhormos commented 2 years ago

Therefore I have neither the .love file associations, nor even the lovegame folder. Only the "no game" is displayed (and works flawlessly by the way). The app did not ask me for any permission at first launch, unlike in my older device that runs android 7. I think this is due to new Android security requirements, but unfortunately I'm not skilled enough to do investigations in this.

Strangely enough the 2019 build present on the app store asks me for storage permission, but I only have access to the lovegame folder and I don't have the .love file association.

The device is a Samsung S20 smartphone if that helps.

MikuAuahDark commented 2 years ago

Unfortunately Android 11 tightens the file access once again, thus the new "lovegame" location is moved. Furthermore it's only accessible through MTP (from PC). There's no point on asking external storage permission if our file access (to the original "lovegame") ended up being rejected anyway.

File association has been broken since Android 7, and again unfortunately there's nothing we can do about it.

Zhormos commented 2 years ago

Thank you very much for this answer. I'm sorry to read this. There are still some points unclear for me - especially the fact I /can/ modify the "lovegame" folder locally on my android12 device and it works, provided I use the old build from the playstore. That puzzles me. Anyway I'll try to do some research and understand it by my side. I'll report here if I find something interesting. Thank you.

MikuAuahDark commented 2 years ago

LOVE 11.3 was targetting Android 9, where the more restricted file access hasn't applied yet. This forces Android to perform compatibility shim by allowing it to write to the lovegame directory.

LOVE 11.4 is targetting Android 12, thus the restricted file access applies to it. If we want to restore 11.3 behavior, we need a "manage external storage" permission. Unfortunately this permission is only meant for file managers or antivirus sanners so our use case doesn't apply to it (and if someday we update Play Store builds to 11.4, it's most likely rejected if we have that permission around).

Zhormos commented 2 years ago

Ah, thank you, I understand better now.

So I think that the turn that the Android platform is taking is disappointing. And besides, many other projects are probably stuck in the same situation. I wonder how they are doing.

Given the situation, from my point of view it would be better for now to make an apk that just works, even if it means giving up compliance with the play store requirements. I'll try to do it at home as soon as possible.

Thank you very much for your clear explanations.

MikuAuahDark commented 2 years ago

Just to add, in next major version of LOVE (12.0), there's a game selector and a menu where you can load arbitrary .love file. You can grab the mightly build in the GitHub Actions.