Skip to content
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

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

Open
DarshanKSPL opened this issue Nov 27, 2023 · 3 comments

Comments

@DarshanKSPL
Copy link

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.

@bhagwandas
Copy link

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)

@Arshad-Ali-1a
Copy link

I am facing the same issue..

@ramachandrach-Kore
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants