Posto
Posto

Reputation: 7550

phonegap cli 6.5 Skipping 'cordova-plugin-camera' for android

Phone Gap Build Getting failed. On Build Log Getting following Error

Installing "cordova-plugin-camera" at "3.0.0" for android

Plugin doesn't support this project's cordova-android version. cordova-android: 6.1.2, failed version requirement: >=6.3.0

Skipping 'cordova-plugin-camera' for android

Getting same issue for cordova-plugin-file-transfer plugin also.

Here is my Config XML

<?xml version="1.0" encoding="UTF-8"?>
<widget
xmlns="http://www.w3.org/ns/widgets"
xmlns:gap="http://phonegap.com/ns/1.0" id="com.myapp.Entry" version="2017.1" versionCode="197">
<name>My App</name>
<description>
    My App
</description>
<author email="[email protected]">
    Sujoy Banerjee
</author>
<!-- Multi-Platform -->
<preference name="phonegap-version" value="cli-6.5.0" />
<preference name="orientation" value="default" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="false" />
<!-- iOS Only-->
<preference name="target-device" value="universal" />
<gap:config-file platform="ios" parent="CFBundleVersion">
    <string>2017.01.0</string>
</gap:config-file>
<gap:config-file parent="NSPhotoLibraryUsageDescription" platform="ios" target="*-Info.plist">
    <string>This app needs access to your Photo Library to include images of the incident</string>
</gap:config-file>
<gap:config-file parent="NSCameraUsageDescription" platform="ios" target="*-Info.plist">
    <string>This app needs to access the camera to include images of the incident</string>
</gap:config-file>
<!-- Android Only-->
<preference name="android-windowSoftInputMode" value="adjustResize" />
<preference name="android-minSdkVersion" value="11" />
<!-- Supproted Platforms -->
<gap:platform name="ios" />
<gap:platform name="android" />
<!-- Core plugins -->
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
<gap:plugin name="cordova-plugin-camera" source="npm" />
<gap:plugin name="cordova-plugin-file-transfer" source="npm" />
<gap:plugin name="cordova-plugin-network-information" source="npm" />
<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
<!-- Icon are here.... -->

Upvotes: 1

Views: 1647

Answers (2)

Greg4572
Greg4572

Reputation: 41

i know i am 6 months late to this, but i just had to go through the same thing. I also found that i could only use the camera plugin version 2.4.1 with any cordova version =< 6.5.0. After doing some research i found that with the cordova jump from 6.5.0 to 7.0.1, some stuff changed and now Phone Gap has different builders. I found that to be able to use the latest version of the camera plugin, i had to specify which Phone Gap builder to use. This forum post is talking about the same issue and they mention this article that talks about the changes in 7.0.1 (see the "Opting out of the new builder" area).

<preference name='pgb-builder-version' value='1' />

After adding the above code to my Config.xml i was able use the camera plugin with its latest version (4.0.3 at time of writing). Now this is how the relevant line look in my Config.xml.

<preference name='phonegap-version' value='cli-7.1.0' />
<preference name='pgb-builder-version' value='1' />

<gap:plugin name="cordova-plugin-camera" version="4.0.3" source="npm" />

I hope this helps somebody as its took me a while to find it.

Upvotes: 2

Maheshvirus
Maheshvirus

Reputation: 7553

After lots of R&D finally i got the key solution.Use older version of cordova camera plugin.Current version is 3.0.0 use older version 2.4.1.

<plugin name="cordova-plugin-camera" spec="2.4.1" />

Upvotes: 3

Related Questions