为了账号安全,请及时绑定邮箱和手机立即绑定

使用FileProvider项目错误

使用FileProvider项目错误

一条小咸鱼 2017-03-21 16:44:20
03-21 08:41:05.674 8666-8666/? E/AndroidRuntime: FATAL EXCEPTION: main                                                 Process: com.example.sty.camertest, PID: 8666                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sty.camertest/com.example.sty.camertest.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)                                                     at android.app.ActivityThread.-wrap12(ActivityThread.java)                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)                                                     at android.os.Handler.dispatchMessage(Handler.java:102)                                                     at android.os.Looper.loop(Looper.java:154)                                                     at android.app.ActivityThread.main(ActivityThread.java:6077)                                                     at java.lang.reflect.Method.invoke(Native Method)                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)                                                  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference                                                     at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:583)                                                     at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:557)                                                     at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:399)                                                     at com.example.sty.camertest.MainActivity.dispatchTakePictureIntent(MainActivity.java:46)                                                     at com.example.sty.camertest.MainActivity.onCreate(MainActivity.java:29)                                                     at android.app.Activity.performCreate(Activity.java:6664)                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)                                                      at android.app.ActivityThread.-wrap12(ActivityThread.java)                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)                                                      at android.os.Handler.dispatchMessage(Handler.java:102)                                                      at android.os.Looper.loop(Looper.java:154)                                                      at android.app.ActivityThread.main(ActivityThread.java:6077)                                                      at java.lang.reflect.Method.invoke(Native Method)                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
查看完整描述

1 回答

?
qq_告白

TA贡献1条经验 获得超0个赞

看一下是否是xml文件有错误,可能不会报出来

查看完整回答
反对 回复 2017-03-22
  • 1 回答
  • 0 关注
  • 3125 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信