EPERM(operation not permitted)

Android手机间使用socket进行文件互传实例 - 星辰之力 - 博客园

今天建了一个新项目,Socket接收文件在新手机上报错:EPERM(operation not permitted),老手机没问题。

找了很久没找到原因,直到看到这里:

anroid存储权限的最佳适配-针对android11也就是api29问题解决EPERM operation not permitted - 简书

WRITE_EXTERNAL_STORAGE no longer provides write access when targeting Android 11+, even when using requestLegacyExternalStorage

我直接来了个推论:降低编译版本回避这个限制。

compileSdkVersion 30
改为
compileSdkVersion 24

猜你喜欢

转载自blog.csdn.net/sonichty/article/details/122642629