Didn't find class "androidx.core.content.FileProvider" on path...

编程知识 更新时间:2023-04-05 06:56:55

这个 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...

本文发布于:2023-04-05 06:56:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/ca577e4413cfec4ce0ead3e8f2ee2898.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:quot   androidx   find   class   FileProvider

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 45407文章数
  • 14阅读数
  • 0评论数