react-native-receive-sharing-intent icon indicating copy to clipboard operation
react-native-receive-sharing-intent copied to clipboard

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

Open DarshanKSPL opened this issue 1 year ago • 4 comments

I'm trying to build an application that will receive shared Excel files using react native. I have used this "react-native-receive-sharing-intent" to receive files but every time I get the below message.

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

I have followed each installation & configuration step mentioned in https://ajith-ab.github.io/react-native-receive-sharing-intent/docs/android.

Issue: There is one more issue with this dependency is when the app is open and then I click on a home screen & open the file manager, select the file, click on the share option & then select my app to open the file so it opens the application but I can't get new latest shared file data in ReceiveSharingIntent.getReceivedFiles() method.

DarshanKSPL avatar Nov 27 '23 19:11 DarshanKSPL

I am also facing the same issue.

It's working fine for sharing text, issue is only with sharing files.

Here is the error message:

Error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getAction()' on a null object reference at Object.promiseMethodWrapper [as getFileNames] (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:4729:36) at ReceiveSharingIntentModule.getFileNames (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:127915:32) at ReceiveSharingIntentModule.getReceivedFiles (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:127895:35) at ShowNotifications. (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:213226:52) at Generator.next () at asyncGeneratorStep (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:21144:26) at _next (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:21163:11) at index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:21168:9 at tryCallTwo (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:25573:7) at doResolve (index.bundle?platform=android&dev=true&minify=false&app=com.merasamaj&modulesOnly=false&runModule=t…:25704:15)

bhagwandas avatar Nov 28 '23 03:11 bhagwandas

I am facing the same issue..

Arshad-Ali-1a avatar Feb 17 '24 18:02 Arshad-Ali-1a

Please follow these steps, particularly in MainActivity.java https://ajith-ab.github.io/react-native-receive-sharing-intent/docs/android

ramachandrach-Kore avatar Jul 02 '24 14:07 ramachandrach-Kore