ImagePicker: cordova-plugin-telerik-imagepicker cannot be added. changes in this plugin conflicts with changes in config.xml. Conflicts must be resolved before plugin can be added.

It seem as if the latest version of ImagePicker is having issues installing in an Ionic app. From what I’ve read the issue is a conflict in the attempt to add the <edit-config> to the plugin.xml while it’s currently present in the config.xml.

This is what i have in the config.xml:

<platform name="android"> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:networkSecurityConfig="@xml/network_security_config" /> <application android:allowBackup="false" /> <application android:fullBackupContent="false" /> <application android:usesCleartextTraffic="true" /> </edit-config>

Even if I delete that from config.xml or delete the <edit-config> attribute in the plugin.xml I keep getting the error when attempting to add the plugin.

Is there any workaround for this?

https://stackoverflow.com/questions/63715976/cordova-plugin-telerik-imagepicker-cannot-be-added-edit-config-changes-in-thi

About this issue

Commits related to this issue

Most upvoted comments

here‘s a simple solution:

  1. remove the broken plugin if you already got install failure
ionic cordova plugin remove cordova-plugin-telerik-imagepicker
  1. download the latest release from github release release v2.3.5.

  2. unzip the source code to plugins folder of project root, and rename it to cordova-plugin-telerik-imagepicker image

note if you want to use git clone to download the source code, remove the edit-config tag from plugin.xml file.

  1. install the plugin and all works!
ionic cordova plugin add cordova-plugin-telerik-imagepicker

the current workaround for this error is: install plugin version 2.3.3 for now till the issues get fixed by telerik team and update below configuration in config.xml file manually. <platform name="android"> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:networkSecurityConfig="@xml/network_security_config" /> <application android:requestLegacyExternalStorage="true" /> </edit-config> </platform>

They have added <application android:requestLegacyExternalStorage="true" /> to config.xml to support imagepicker in android 10 devices.

@syftedesigns : seems that you are beginner in ionic. you have to install 2 library, 1 for cordova and another for javascript.

ionic cordova plugin add cordova-plugin-telerik-imagepicker@2.3.3
npm install @ionic-native/image-picker

add this plugin to your app module.


...

import { ImagePicker } from '@ionic-native/image-picker/ngx';

...

@NgModule({
  ...

  providers: [
    ...
    ImagePicker
    ...
  ]
  ...
})
export class AppModule { }

refer this link for usage: https://ionicframework.com/docs/native/image-picker

The best solution to solve the issue is to add image picker plugin via git cordova plugin add git+https://github.com/Telerik-Verified-Plugins/ImagePicker.git#2.3.4

Try this, it’s working for me!

Guys, Seems many are stuck due to this issue. Can any volunteer submit PR for this here ?

I’ve found that the improper use of version numbers means they cannot be relied upon to get consistent downloads of the plugin. So the command I used to get a version that would install was:

ionic cordova plugin add git+https://github.com/Telerik-Verified-Plugins/ImagePicker.git#307749d30f7b0496274c5f380d33e75ad7315685 --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="Your usage description here."

It is version 2.3.5 before it was broken. You will still need to manually edit the config.xml file as described above.

@chetanmore0510

thank you so much , resolve my problem perfectly 。

i use ionic4 and add cordova plugin cordova-plugin-telerik-imagepicker but it doesnt work say that xxxx\plugins\cordova-plugin-telerik-imagepicker\src\android\com\synconset\ImagePicker\ImagePicker.java already exist 。 there are my steps

  1. remove the old cordova-plugin-telerik-imagepicker and execute ionic cordova plugin add cordova-plugin-telerik-imagepicker@2.3.3 npm install @ionic-native/image-picker
  2. add <application android:requestLegacyExternalStorage="true" /> to config.xml
  3. modified cordova.system.library.2=com.android.support:support-v4:27.+ to cordova.system.library.2=com.android.support:support-v4:26.+ in \platforms\android\project.properties it finally worked !

Yes, It works for me. Please make sure you have updated android sdk tools. Cordova CLI : 10.0.0 Cordova Platforms : android 9.0.0 cordova-plugin-telerik-imagepicker 2.3.3 config.xml: <preference name="android-minSdkVersion" value="22" /> <preference name="android-targetSdkVersion" value="29" /> <platform name="android"> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:requestLegacyExternalStorage="true" /> </edit-config> <config-file parent="/manifest/application" platform="android" target="AndroidManifest.xml"> <activity android:label="@string/multi_app_name" android:name="com.synconset.MultiImageChooserActivity" android:theme="@style/Theme.AppCompat.Light" /> </config-file> </platform>

Don’t forget to remove and add platform after doing the above changes. All the best

On Wed, Oct 14, 2020 at 3:22 AM jun.zhao notifications@github.com wrote:

@chetanmore0510 https://github.com/chetanmore0510 I get the following error when i use application android:requestLegacyExternalStorage=“true” #212 https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/212

Do you resolve the problem? I also hit this error, I build android by ionic, the error is “AndroidManifest.xml:58 attribute android:requestLegacyExternalStorage not found.”

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/216#issuecomment-708113781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG52PBH6RD6JONXAERQLQSLSKUDNNANCNFSM4QYM6YRQ .

ionic cordova plugin add cordova-plugin-telerik-imagepicker@2.3.3

You can specify version number after @. this will download specific version of plugin, otherwise it will pick the latest one.

you can see the various versions on given link https://www.npmjs.com/package/cordova-plugin-telerik-imagepicker?activeTab=versions