So... i finished a little app designed to be used on Android and you need to pick an image from your phone, to achieve this i made an in-game file explorer using nativefs(https://github.com/EngineerSmith/nativefs). Everything works fine when using the löve app you can easily install on the Play Store.
However, when i build the game using APKTool, i can't handle to ask for reading storage permission.
My AndroidManifest.xml looks like this:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest package="insert.package.com"
android:versionCode="7"
android:versionName="0.0.6"
android:installLocation="auto" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>
<uses-feature android:glEsVersion="0x00020000"/>
<application
android:allowBackup="true"
android:icon="@drawable/love"
android:label="insert label lol"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
<activity
android:configChanges="orientation|screenSize"
android:label="insert label lol"
android:launchMode="singleTask"
android:name="org.love2d.android.GameActivity"
android:screenOrientation="fullSensor"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="tv.ouya.intent.category.GAME"/>
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
</activity>
</application>
</manifest>
when i install the APK and go to app permision setting and select the app, i found out the game is not even asking for storage permission. I tried different things, like changing the target SDK to something lower than 22 (so i don't need to ask for permission in runtime), changing from love 11.3 to 11.4 and a bunch more things that didn't work, so...
¿How can i make my app ask for storage permission so the user can enable it throught settings?
and otherwise,
¿How can i ask for storage permission on runtime?
Thanks in advance.
EDIT:
I forgot to mention that i tested this on android 11 and android 13 and both have the same problem.