- Home /
I cant set up the permissions/ i dont have AndroidManifets.xml
I wanted to read users data like images to use it in the game. This needs to the user can set up own pictures. But there is a several problems to me. I know that i need permissions to read and write data and i need to set those permission into the AndroidManifets.xml, but i dont have it. Insted i have LauncherManifest.xml and UnityManifest.xml. Which one i should use to set up my permission.
Answer by xxmariofer · Jan 29, 2021 at 02:01 PM
Simply create your own AndroidManifest.xml in yoour project and unity will mix it with its own manifest. The permision for reading and writing data can be set in the
project settings > player > other settings > write permission
and unity will automatically add them to the manifest
Just create an empty file Plugins/Android/Android$$anonymous$$anifest.xml?
thanks its working for external storage now would it work for internal storage too? and its asking for permissionon the start of the game, how can i make it not asking for permission on the start. and one more question almost each android device has its own dcim path is there a solution to find dcim folder for each android device?
Yes, create an empty Plugins/Android/Android$$anonymous$$anifest.xml, it doesnt need to be in that path but is a good practice, (you can pick a manifest sample from the web, it doesnt need to be empty, unity will merge them on the export) second, I am not sure if I understand your issue, if your app requieres a permision that is not granted by default the user needs to grant it manually, thats android politics to avoid harmfull apps. I am not aware about the dcim path in unity, most likely you need to build your native plugins in android studio and use it from unity, or simply use one of the solutions provided by third parties like (I havepersonally used this and if you want to get the path to a video/image in the gallery this works perfectly) :
thanks ill try it