-
Notifications
You must be signed in to change notification settings - Fork 906
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 targeting API Level 30 needs permission #1150
Comments
thanks. Exception for google Search.. java.lang.ArrayIndexOutOfBoundsException: |
Yes, this solve the issue on Android 11 AndroidManifest.xml |
I'm facing the same issue. |
Not sure I can help, I added the permission and it solved my issue, you'll probably need to debug and see where it fails... That's what I did... |
@chrisjdev when this fix will be released for cordova? https://www.npmjs.com/package/cordova-plugin-x-socialsharing |
@mad-na Sorry, in my comment referencing this issue, I was saying my change didn't completely solve the issue, so I wasn't planning to do a pull request. Also, for other reasons, I'm planning to switch to using share() instead of shareViaEmail(), so I likely won't spend any more time on this. |
Also worth mentioning that the solution to add a permission requires adding an explanation in the google play store as can be read here: |
@HarelM Yes, setting global permission is therefore no longer a good option. I have struggled through this (and ended up with @bhandaribhuminpfizer solution):
Tested with corova-android 9.1.0 on Android 10 and Android 11 Feedback is welcome |
@GloriaTM thanks for the info!! |
In my case this works: Procedure like @GloriaTM posted, but in config.xml:
Tested with cordova-android@11.0.0 on real Android 8.1 (API 27), Android 11 (API 30) and Android 12 (API 31) devices |
For me, I just removed the namespace tags, and it worked:
|
To sharing on Fb and email with Android 12, i need to add fb package
|
This worked for me! Thanks! |
Ionic/Angular/Capacitor app:
I have removed and added this:
|
Still, it is not working in android 12 and above devices. app is getting crashed |
I have a working app targeted to Android 13. |
Thanks for the quick response. Currently, I am using angular 12.1.4 and cordova -11. It was working fine in ios. In android, greater than 11 android versions getting crashed. Error: |
Did you follow the above suggestion? |
I tried to update social-sharing plugin -6.3.0 and also followed the above procedure which you suggested.Still, no luck in result. |
If you add this persmission in Manifest file, app may got rejected due to the play console policy. |
Hi!
My App with targetSdkVersion=30 crashed on Android 11 calling
shareViaEmail
withjava.lang.ArrayIndexOutOfBoundsException
I think the reason is that you now need permission to have full access to the list of all installed apps:
https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9
Solution:
Add the following to AndroidManifest.xml
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
Adding following permission to config.xml to generate AndroidManifest.xml with this permission.
I hope this helps someone,
GTM
The text was updated successfully, but these errors were encountered: