achorein / expo-share-intent-demo

React Native Expo Share Intent Demonstration
89 stars 9 forks source link

[android] Warning: java.lang.NullPointerException on android.content.Intent.getAction() #11

Closed linonetwo closed 1 year ago

linonetwo commented 1 year ago

Thanks for the example! It works!

I get this warning, while the callback invocks successfully, so this don't seem to be a big problem, right?

[{"contentUri": null, "extension": null, "fileName": null, "filePath": null, "subject": null, "text": "alovoa", "weblink": null}]

EDIT:

[Error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getAction()' on a null object reference]
achorein commented 1 year ago

I presume you are on Android, your error is related to react-native-receive-sharing-intent package, here the corresponding issue https://github.com/ajith-ab/react-native-receive-sharing-intent/issues/81

I will update the patch to handle this, but if you say it works, no need to worry about it.

Which Expo SDK version are you using ?

achorein commented 1 year ago

@linonetwo it seems that my patch already handle it. Make sure this patch is applied on your project.

linonetwo commented 1 year ago

I just copied the patch yesterday https://github.com/tiddly-gittly/TidGi-Mobile/tree/master/patches

And I'm only using Android part, because I don't have an iOS to test it... That is strange, but as long as the feature is working (tested today in my app), I'm closing this issue.

This might be caused by my setup or expo build? I use npx expo start --dev-client --android to generate a debug client with these modifications.