NPE invoking ProviderInfo.loadXmlMetaData(PackageManager, String)
See original GitHub issueGoal: capture image via camera. Device: Google Nexus 6P OS: Android 7.1.1, API 25
Exception at line #95.
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.kbeanie.multipicker.core.ImagePickerImpl.takePictureWithCamera(ImagePickerImpl.java:144)
at com.kbeanie.multipicker.core.ImagePickerImpl.pick(ImagePickerImpl.java:120)
at com.kbeanie.multipicker.api.CameraImagePicker.pickImage(CameraImagePicker.java:74)
Any clues are greatly appreciated.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
npe attempting to invoke XmlResourceParser on a null String ...
The problem was that in Manifest I had this line: android:authorities="com.example.asd.fileprovider". and when calling getUriForFile I was passing:
Read more >[SOLVED]Error at Taking picture with intents(Need Serious ...
ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference at android.support.v4.content.
Read more >Exception when running on a real device with Android custom ...
NullPointerException : Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData( ...
Read more >Xamarin Droid using FileProvider.GetUriForFile - Microsoft Q&A
ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference\n at Java.Interop.
Read more >Delphi 10.4.1 on Android error : java.lang.NullPointerException
ProviderInfo.loadXmlMetaData (android.content.pm.PackageManager, java.lang.String)” only on “release” version of your application, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can you try this? Create a class extending FileProvider. And use that class name here? If that solves the issue for you, I will update the library to use a custom FileProvider.
Hey… i think you should check out the Package name provided in parser if you are using like following
Check if package name matches with yours