android studio open failed: EACCES (Permission denied)(第一行代码第十章下载测试总是失败)


在学习android 下载的部分时,由于当前使用的android版本较高,总是出现访问权限问题---文件打开失败。通过科学地上网终于找到解决办法》》

Add android:requestLegacyExternalStorage="true" to the Android Manifest It's worked with Android 10 (Q) at SDK 29+ 

or After migrating Android X.

在AndroidMainfest.xml中添加android:requestLegacyExternalStorage="true"

 

 1 <application
 2     android:name=".MyApplication"
 3     android:allowBackup="true"
 4     android:hardwareAccelerated="true"
 5     android:icon=""
 6     android:label=""
 7     android:largeHeap="true"
 8     android:supportsRtl=""
 9     android:theme=""
10     android:requestLegacyExternalStorage="true">

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM