Caused by: java.lang.IllegalStateException: Unable to create directory in Android 6.0 devices

后端 未结 3 1286
野趣味
野趣味 2021-01-18 09:17

I have to store the download the image from the url using DownloadManager and store it into the sdcard with my own directory like \"xyz\". This is my code

Fi         


        
3条回答
  •  别那么骄傲
    2021-01-18 09:48

    The problem is that you need write permission to download a file and that is not supported in Instant apps. As you can see in the following link https://developer.android.com/topic/google-play-instant/faqs#general this are the supported permissions in Instant apps.

    Which permissions are available to an instant app?

    Instant apps can use the following Android permissions:

    • BILLING
    • ACCESS_COARSE_LOCATION
    • ACCESS_FINE_LOCATION
    • ACCESS_NETWORK_STATE
    • CAMERA
    • INSTANT_APP_FOREGROUND_SERVICE only in Android 8.0.
    • INTERNET
    • READ_PHONE_NUMBERS. This permission is available only in Android 8.0 (API level 26).
    • RECORD_AUDIO
    • VIBRATE

提交回复
热议问题