android.support.v4.content.FileProvider
在编辑AndroidManifest.xml文件中我发现在
<provider
android:authorities="com.example.cameraalbumtest.fileprovider"
android:name="android.support.v4.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"/>
</provider>
书中所讲的
android:name="android.support.v4.content.FileProvider"
这行代码在AS3.5中提示会出现错误,BUG等因素然后无法引用android.support.v4包
在我查阅很多资料后,发现这个包已经被
androidx.core.content.FileProvider所代替
所以吧上述代码改成:
<provider
android:authorities="com.example.cameraalbumtest.fileprovider"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"/>
就解决了问题!这个坑啊!!