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

Android Crash when calling .showShareSheet with Plugin Version 3.0.0 #27

Open
stevecarlton opened this issue Jan 24, 2021 · 2 comments
Open

Comments

@stevecarlton
Copy link

Hello!

I've already implemented this plugin and it works perfectly for iOS. For Android, opening branch links works but sharing does not. I am getting a fatal native crash and not sure where to start. I've triple checked all of the implementation steps for Android and it seems like things are in order, but in logcat I see this crash when calling BranchDeepLink.showShareSheet().

Serious error executing plugin
java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99)
	at com.getcapacitor.Bridge$1.run(Bridge.java:542)
	at android.os.Handler.handleCallback(Handler.java:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:214)
	at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.app.Activity.getResources()' on a null object reference
	at co.boundstate.BranchDeepLinks.getShareSheetStyle(BranchDeepLinks.java:268)
	at co.boundstate.BranchDeepLinks.showShareSheet(BranchDeepLinks.java:121)
	... 7 more

Any ideas where to start?

ionic info

Ionic:

   Ionic CLI                     : 6.12.3 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.5.1
   @angular-devkit/build-angular : 0.1100.3
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 10.0.8
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI   : 2.4.4
   @capacitor/core : 2.4.4

Utility:

   cordova-res : 0.15.2
   native-run  : 1.3.0

System:

   NodeJS : v10.15.3 (/usr/local/bin/node)
   npm    : 6.13.4
   OS     : macOS Big Sur
package.json
"capacitor-branch-deep-links": "^3.0.0",
@stevecarlton stevecarlton changed the title Android Crash when calling .showShareSheet Android Crash when calling .showShareSheet with Plugin Version 3.0.0 Jan 25, 2021
@tafelnl
Copy link
Contributor

tafelnl commented Feb 10, 2021

I have identified the cause of this issue. Will try to create a few PR's sometime soon to improve this library.

@psnfrench
Copy link

Upgrading to the latest version of the plugin resolved this issue for me (version 3.0.2)

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

3 participants