Ionic sdk 29 permissions issue - happen in many plugins

Hi All,

recently we got a message from play console that we must update “android-targetSdkVersion” to 29. (android 10)

now, the problem is that android made a big permission update, and most of the plugins (I’m using many of them) are not supported in the new permission update. (such as File,ImagePicker,PhotoLibrary…)

from August 2020, new apps will have set their config to SDK=29, and existing apps will have time until November. so I have a little time until November, and then, If we will not have an update for all the plugins, no one will be able to develop with IONIC.
so, ionic team, will we have any solution for that? we need it ASAP

I think adding
<preference name="android-targetSdkVersion" value="29" /> to your config.xml should work?

Hi,

That’s exactly the problem. I i will do it, i will get errors when messing with plugins that uses files.
Therefore, i need to target 28

1 Like

Mhh i also added this Line to fit to the Store. When do you receive error? While building the App?

hi,

if I set it to android-targetSdkVersion" value=“29” so I will get an error while using the following plugins:
File
ImagePicker
PhotoLibrary

you get this error only on a smartphone that has android 10. in S8 for example, which holds android 8 I think I have no issues, but in S20, which holds android 10 you will get errors, and you will not be able to use the plugins above.

Unless you’re using Ionic enterprise, Ionic team has nothing to do with the community plugins. The plugin creators must update their plugins. Thats one of the problems when using 3rd party add ons, goodluck. :slightly_smiling_face:

For the File Plugin, it seems to be known: https://github.com/apache/cordova-plugin-file/issues/408

@EinfachHans i know. i’m working for a solution for all those plugins. already forked one of them with PR.
working on the file plugin now. (as you can see in your link , i am the last one with comment.)

i’m trying to say, that Ionic guys needs to handle those situations, because if we will not have any plugins to use, so no one will use Ionic.

1 Like

These are Community Plugin, Ionic has nothing to do with, so it’s not Ionic’s Job to make them work. As @mikrochipkid said, ionic offers some Premier Plugins in Enterprise. This will be maintained by Ionic and Errors like these will be focused fast. For now the best you can do is create PR’s and if they don’t get merged (maybe because the repo is archived) you can fork the plugin, change what you want and install the Plugin from your github repo directly

Hi @Sahbak, have you got the solution.
are you able to use
image picker,
photo library,
plugins while you target for android SDK 29…

Thank you reply asap

Hi @RajeshReddy,

yes i’m able to use all of them. i made PR to most of those plugins to fix the issue.

which plugin are you having problem with ? what error you get ?

thanks

Thank you @Sahbak

I am having an issue with
image-picker and PhotoLibrary plugins. when the app is targeted to android SDK level 29

the error I am getting while triggering image picker in Android 10 mobile is =>“The image File Could not be opened”.

Hi @Sahbak can you please send me the URL of the PR that you have taken…

Thank you

hi @RajeshReddy

no worries, it will work :slight_smile:

try the following:
1)run the following command “ionic cordova plugin remove cordova-plugin-file --force”

  • force is because “file” plugin is a dependency of photo library plugin
    2)run the following command “ionic cordova plugin add git://github.com/apache/cordova-plugin-file.git#master”
  • we will take from git the branch with the PR
    3)run the following command “ionic cordova platform remove android”
  1. run the following command “ionic cordova platform add android”

that should work. please update :crossed_fingers:

HI @Sahbak
I am using ionic 3 and cordova 8.1.1
and
image picker will also work if do the same thing.

thank you

hi @RajeshReddy ,

what great news :slight_smile:

can you please just mark my answer as the solution? it will be highly appreciated

Hi Sahbak,

I’m using your solution now, however it doesn’t work. Can i know do you do anything else for example: android:requestLegacyExternalStorage=“true” according this discussion https://github.com/apache/cordova-plugin-file/issues/408?

Below are my ionic info, thank you.

Ionic:

ionic (Ionic CLI) : 4.2.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 7.1.0
Cordova Platforms : android 9.0.0, browser 5.0.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 1.2.1, (and 23 other plugins)

System:

ios-deploy : 1.9.2
NodeJS : v10.12.0 (/usr/local/bin/node)
npm : 2.15.12
OS : macOS
Xcode : Xcode 11.6 Build version 11E708

Hi, have you find a solution? I’m facing same with ionic base64togallery plugin.

Hi,

I had the same issue with base64togallery plugin and I managed to solve it. To whom struggling , I have explained it in my StackOverflow answer.