Can't create a directory on /storage/emulated/0 on emulator

前端 未结 2 1271
余生分开走
余生分开走 2020-12-20 15:09

I\'m trying to create a directory on my android emulator but I can\'t do it, I already have the permission on manifest write_storage, and I get no erros but mkdir() return f

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-20 15:54

    You have to options:

    • Downgrade your compileSdkVersion and targetSdkVersion to lower version in your build.gradle
    • Request write permission at runtime is required on Android 6 .

    I personally don't advice the first one. For more info check:

    • Android 6.0 Marshmallow. Cannot write to SD Card
    • Google Play services 8.1 and Android 6.0 Permissions

    Hope this helps!!

提交回复
热议问题