Problem with sharing a file via Intent with another app as a FileProvider
- Android Development
- 1 Replies
Your clue to the cause of the crash is this section from the stack trace
This tells you the exception that crashed your app, and the line in your code which caused it.
So Googling around that error "Attempt to invoke virtual method 'android.content.res.XmlResourceParser ", turns up this link on StackOverflow, amongst others
https://stackoverflow.com/questions...-to-invoke-xmlresourceparser-on-a-null-string
Code:
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:605)
at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:579)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:417)
at com.example.sprite.half_lifetimer.ExportDatabase.shareJSON(ExportDatabase.java:109)
This tells you the exception that crashed your app, and the line in your code which caused it.
So Googling around that error "Attempt to invoke virtual method 'android.content.res.XmlResourceParser ", turns up this link on StackOverflow, amongst others
https://stackoverflow.com/questions...-to-invoke-xmlresourceparser-on-a-null-string

