ImagePicker: "com.synconset.imagepicker" incorrectly adding to package.json dependencies

When using this plugin with Ionic (as per http://ionicframework.com/docs/native/image-picker/) it’s breaking.

After running ionic cordova plugin add cordova-plugin-telerik-imagepicker and npm install --save @ionic-native/image-picker everything seems fine.

But when you then go to use ionic cordova run or ionic cordova build a reference to "com.synconset.imagepicker" is inserted into the package.json dependencies list. This is not a valid node module name, so it fails the next time npm install is run.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 13
  • Comments: 28

Most upvoted comments

@azeemse Yes, the only way I found is just about android package version, you need to downgrade at android 6.3.0.

Here are my notes on this subject (you don’t need to do it for ios if you don’t have any problem):

Check versions (see /config.xml or command “$ ionic info”):

  • android : 6.3.0
  • ios : 4.5.2

Steps:

  • Delete subfolders /plugins
  • Delete platforms with commands:
$ ionic cordova platform rm android
$ ionic cordova platform rm ios
  • Force delete /platform folder if needed

Run prepare command:

$ ionic cordova prepare

Reinstall platforms:

$ ionic cordova platform add android@6.3.0
$ ionic cordova platform add ios@4.5.2
  • On IOS platform, The GoogleService-Info.plist file can be wrong: => copy this file: /platform/ios/MyApp/Resources/GoogleService-Info.plist => paste and replace this one: /platform/ios/MyApp/Resources/Resources/GoogleService-Info.plist

  • IOS again, check the “value” attributes in config files (iTunes Connect will refuse the package without it) :

– config.xml

<plugin name="com.synconset.imagepicker" spec="~2.1.8">
        <variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="Allows users to select a profile picture for their profile." />
</plugin>

– package.json

"com.synconset.imagepicker": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "Allows users to select a profile picture for their profile."
}

It’s a big waste of time, for sure.

I found a workaround by removing the single line "com.synconset.imagepicker": "~2.1.8" from package.json. And "com.synconset.imagepicker": { "PHOTO_LIBRARY_USAGE_DESCRIPTION": "Add multiple photos" } shows warning while execute the commands like: cordova platform add android and cordova run android. It worked for me. But we need to inform this to ionic team, i believe it’s a bug.

Actually, it’s not a Cordova version issue but a telerik image picker plugin issue I guess, they aren’t update it to the new folder tree of Cordova Android version

If so then at least Ionic should update their documentation with some verified image picker. They are still using the Telerik image picker in their docs.

https://ionicframework.com/docs/native/image-picker/

@qw1210p Was the same workaround commented by @2010abinas .

removing the single line “com.synconset.imagepicker”: “~2.1.8” from package.json.

It worked for me, but I think not be the best solution.

Hi guys, follow the infos here, no need to downgrade cordova. It works on 7.1.0 Cordova hook for Manifest.xml

in Ionic2 if you are using any existing project and you do npm install, after that time just remove the com.synconset.imagepicker plugin from package.json and config.json as well. Because the com.synconset.imagepicker is not present in npm directory that’s why we get error. After doing all the set up then install com.synconset.imagepicker plugin, it will work perfect.