Ionic 6 cordova app crashing on android 13 device while using social sharing. Upto android version 12 working fine. When i select social media platform like WhatsApp, Twitter, Facebook to share data app getting crashed.
I’m using social sharing plugin
what version of social sharing plugin are you using?
cordova-plugin-x-socialsharing 6.0.4 “SocialSharing”
I have used the below commands to install the social sharing plugin
ionic cordova plugin add cordova-plugin-x-socialsharing
npm install @awesome-cordova-plugins /social-sharing
Thanks, was just to verify that you weren’t using an older version that didn’t work, but if using 6.0.4 it should work.
What’s the crash message?
For whatsApp
Unable to find explicit activity class {com.whatsapp/com.whatsapp.contact.picker.ContactPicker}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?
For Facebook
Unable to find explicit activity class {com.facebook.katana/com.facebook.composer.shareintent.ImplicitShareIntentHandlerDefaultAlias}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?
I have added
<activity android:name="com.whatsapp.contact.picker.ContactPicker" android:exported="true"/>
in the AndroidManifest.xml for whatsApp still crashing the app and giving same error
It’s a know bug on the plugin
opened 11:22AM - 29 Nov 22 UTC
After add
` <queries>
<package android:name="com.facebook.katana" … />
<package android:name="com.whatsapp" />
<package android:name="com.twitter.android" />
</queries>`
The canShare let us share to Facebook, Whatsapp or Twitter.
But on share we have an exception for Facebook and Twitter
`Fatal Exception: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.twitter.android/com.twitter.app.dm.DMActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2171)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1805)
at android.app.Activity.startActivityForResult(Activity.java:5583)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:647)
at android.app.Activity.startActivityForResult(Activity.java:5541)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:628)
at org.apache.cordova.CordovaInterfaceImpl.startActivityForResult(CordovaInterfaceImpl.java:69)
at nl.xservices.plugins.SocialSharing$2$1.run(SocialSharing.java:348)`
And For facebook:
`Fatal Exception: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.facebook.katana/com.facebook.composer.shareintent.ImplicitShareIntentHandlerDefaultAlias}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2171)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1805)
at android.app.Activity.startActivityForResult(Activity.java:5583)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:597)
at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:352)
at android.app.Activity.startActivityForResult(Activity.java:5541)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:583)
at org.apache.cordova.CordovaInterfaceImpl.startActivityForResult(CordovaInterfaceImpl.java:69)
at nl.xservices.plugins.SocialSharing$2$1.run(SocialSharing.java:348)`
I have done some research and it seems a problem just in Android 13.
I have tested changing AndroidManifest.
https://developer.android.com/guide/components/intents-filters#ExampleFilters
But I have not been able to fix the problem