-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser #103
Comments
+1 |
Add this code to your manifest file :
|
It's solved! Thanks @RuslanTroshkov! |
@malavancs check issue #200 |
Hi. I'm new to android programming and am stuck up in a similar way. As suggested: I have changed those lines in my manifest to: But it seems like I'm making some mistake as I'm getting the same error as above: And this is the snippet of the code which appears to be a problem:
|
I think the file path provider path mentioned in manifest and one being used in start activity have different package path. I mean you missed the subpackage "trialcamera" missing. As i see in Manifest you mentioned: While in source code accessing the fileprovider using You can add in source as this way: FileProvider.getUriForFile(MainActivity.this, getApplicationContext().getPackageName()+ ".trialcamera.fileprovider", getOutputMediaFile() ); or, hard code the package path as ileProvider.getUriForFile(MainActivity.this, "com.example.android.trialcamera.fileprovider", getOutputMediaFile() ); One thing to look is the authority mentioned in manifest should be same as that being used in source file to get file URI. |
Use the fully qualified name of the cordova plugin in the provider tag in android manifest file. Similar issue i was facing in fileopener plugin. See the resolution below |
Non Of This Which GitHub Or Anywhere It Provider Pattern Working In Android 8. |
And in paths.xml i put |
How is tools defined? |
xmlns:tools="http://schemas.android.com/tools" |
Thank you @callmeblue |
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
02-01 18:11:36.687 1240-1240/uk.co.digpath.merlin W/System.err: at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:560)
02-01 18:11:36.687 1240-1240/uk.co.digpath.merlin W/System.err: at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:534)
02-01 18:11:36.687 1240-1240/uk.co.digpath.merlin W/System.err: at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:376)
02-01 18:11:36.687 1240-1240/uk.co.digpath.merlin W/System.err: at pl.aprilapps.easyphotopicker.EasyImageFiles.getUriToFile(EasyImageFiles.java:142)
02-01 18:11:36.687 1240-1240/uk.co.digpath.merlin W/System.err: at pl.aprilapps.easyphotopicker.EasyImage.createCameraPictureFile(EasyImage.java:56)
02-01 18:11:36.687 1240-1240/uk.co.digpath.merlin W/System.err: at pl.aprilapps.easyphotopicker.EasyImage.createCameraIntent(EasyImage.java:86)
The text was updated successfully, but these errors were encountered: