Under a recent visit to a local camera video files on Android10 system error:
Huawei test on Mate30
FileNotFoundException(/storage/emulated/0/DCIM/Camera/xx.mp4) open failed: EACCES(Permission denied
Second, create a new folder inside add a xml xml file name in the directory, such as res: file_paths.xml
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<root-path
name="root"
path="." />
<files-path
name="files"
path="." />
<cache-path
name="cache"
path="/"/>
<external-path
name="external"
path="." />
<external-cache-path
name="external_cache"
path="." />
<external-files-path
name="external_file"
path="." />
</paths>
Element must contain one or a plurality of sub-elements. These sub-element is used to specify the directory path to share files, you must be one of these elements:
<Files-path>: internal storage application files / directories under the private directory, equivalent to Context.getFilesDir () acquired directory path;
<Cache-path>: internal storage application cache / private directory under the directory is equivalent to Context.getCacheDir (acquired directory path);
<External-path>: external storage root, equivalent to Environment.getExternalStorageDirectory () acquired directory path;
<External-files-path>: external storage application files / directories under the private directory, the directory path is equivalent to Context.getExternalFilesDir (null) acquired;
<External-cache-path>: Application of external storage cache / private directory under the directory, equivalent to Context.getExternalCacheDir ();
Add in the application
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
AndroidManifest.xml configured through the storage rights;
<application
android:requestLegacyExternalStorage="true">
This perfect solution