Using Qiniu Cloud to upload avatars involves local uploading or photo uploading. Systems below 10 can run normally. For Android 10, operate taking photos, or upload, report errors, log, and the path to get photos is empty.
Solution:
Add android:requestLegacyExternalStorage="true" to the application in AndroidManifest.xml for a temporary solution. Compatible up to Android 11. Or targetsdk lowered to below 29.
Selecting the path of the original image will also change to content://, which is also unreadable, and the path needs to be converted

val uri = Uri.parse(path);
val projection = arrayOf<String>(
MediaStore.Images.Media.DATA _
)
val cursor = ActivityUtils.getTopActivity()?.contentResolver
?.query(uri, projection, null, null, null) ?: return ""
val index =
cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst()
val imgPath = cursor.getString(index)
var relPath = File(imgPath). absolutePath
cursor.close()