Closed Gachapen closed 6 years ago
Thanks for the pull request. I have just returned from a week off work so I'll take a look at it when I get a chance.
I took a look but I got an error - I think you also need to update https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/blob/master/src/android/IntentShim.java#L319, can you please check?
You're right, I'm getting this error as well. I will fix it.
I was a bit quick to reply. I actually don't get the error, but I see why, and I also think I understand why I, and some others, get the NullPointerException.
In my project, I actually have two providers, one from this plugin, providing FileProvider
, and one from https://github.com/katzer/cordova-plugin-local-notifications, providing a class inherited from FileProvider
. Both of these specifies ${applicationId}.provider
as authorities, which I think is the cause of the exception (because of a conflict). Changing this plugin to use ${applicationId}.fileprovider
probably has resolved this conflict, and thus also the exception, but it now uses the other derived FileProvider
. Therefore, I don't think this is an issue specific for this plugin, but rather an issue when combining multiple plugins.
I'm not sure how this could be solved in a good way. Maybe change the authorities to something more unique, like ${applicationId}.darryncampbell.cordova.plugin.intent.fileprovider
?
Thanks, I think the suggestion to use unique names makes sense. I went ahead and implemented the fix in version 1.1.1. If that works for you then I will close this pull request.
Great, thanks. I won't be publishing a new version of our app yet, so I can't say for sure that it will work, but it should, as my current workaround (with a different name) works. So I'll close the PR and rather create a new if necessary.
I got several crash reports in Google Play that had this cryptic stack trace:
After some googling, I discovered that the authority for the FileProvider provider in AndroidManifest.xml should be
${applicationId}.fileprovider
instead of${applicationId}.provider
, which is also what the official documentation specifies (https://developer.android.com/reference/android/support/v4/content/FileProvider).Updating the app with this change seems to have silenced these crash reports. I'm not an expert in Android development, so I'd be glad if anyone could confirm that this change is correct.