这个 bug 跟 AndroidManifest 中的 一块设置有关:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.instance"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_path" />
</provider>
原因查找:
在 app\build.gradle 中少了一个配置——
compileOptions {
// 1.8 是我的 jdk 版本
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
将上面配置代码放到 android{} 中即可~
更多推荐
Didn't find class "androidx.core.content.FileProvider" on path...
发布评论