问题
The following config.xml results in error:
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="LogIn" version="1.0.1" versionCode="10" >
<name>...</name>
<description>...</description>
<author >...</author>
<preference name="phonegap-version" value= "3.5.0" />
<preference name="orientation" value= "default" />
<preference name="target-device" value= "universal" />
<preference name="fullscreen" value= "true" />
<preference name="webviewbounce" value= "true" />
<preference name="android-installLocation" value= "internalOnly" />
<preference name="splash-screen-duration" value= "0" />
<preference name="load-url-timeout" value= "20000" />
<access origin="*" />
<feature name="http://api.phonegap.com/1.0/notification" />
<feature name="http://api.phonegap.com/1.0/file" />
<feature name="http://api.phonegap.com/1.0/media" />
<feature name="http://api.phonegap.com/1.0/battery" />
<feature name="http://api.phonegap.com/1.0/camera" />
<feature name="http://api.phonegap.com/1.0/contacts" />
<feature name="http://api.phonegap.com/1.0/geolocation" />
<feature name="http://api.phonegap.com/1.0/network" />
<gap:plugin name="org.apache.cordova.dialogs" ></gap:plugin>
<gap:plugin name="org.apache.cordova.device" ></gap:plugin>
<gap:plugin name="org.apache.cordova.device-orientation" ></gap:plugin>
<gap:plugin name="org.apache.cordova.splashscreen" ></gap:plugin>
<gap:plugin name="org.apache.cordova.camera" ></gap:plugin>
<gap:plugin name="org.apache.cordova.device-motion" ></gap:plugin>
<gap:plugin name="org.apache.cordova.network-information" ></gap:plugin>
<gap:plugin name="org.apache.cordova.battery-status" ></gap:plugin>
<gap:plugin name="org.apache.cordova.vibration" ></gap:plugin>
<gap:plugin name="org.apache.cordova.geolocation" ></gap:plugin>
<gap:plugin name="org.apache.cordova.globalization" ></gap:plugin>
<gap:plugin name="org.apache.cordova.file" ></gap:plugin>
<gap:plugin name="org.apache.cordova.inappbrowser" ></gap:plugin>
<gap:plugin name="org.apache.cordova.media" ></gap:plugin>
<gap:plugin name="org.apache.cordova.media-capture" ></gap:plugin>
<gap:plugin name="org.apache.cordova.contacts" ></gap:plugin>
<gap:plugin name="org.apache.cordova.file-transfer" version="0.4.3" ></gap:plugin>
<plugin name="cordova-plugin-file-opener2" source="npm" />
</widget>
Error message:
Error Image
The codebase is inherited and as I understand, the configuration used to compile correctly. Removing the plugin in the error results in the following plugin on the list taking its place in the error.
Changing
<preference name="phonegap-version" value= "3.5.0" />
to
<preference name="phonegap-version" value= "3.7.0" />
and formatting the plugins from
<gap:plugin name="org.apache.cordova.dialogs" ></gap:plugin>
to
<gap:plugin name="org.apache.cordova.dialogs" source="npm" ></gap:plugin>
seems to allow it to build, but the plugins do not function in the App.
Any and all help or suggestions will be greatly appreciated.
回答1:
For any of you having the same problem, I found a solution:
What it boils down to:
Go to: PhoneGap Plugins Page
(I'm using contacts as an example here) and click on the [Old Plugins] tab. Now find your plugin and open its link under the [PBG Plugin ID] column. Use the
<plugin name="org.apache.cordova.contacts" spec="0.2.16" source="pgb" />
as described under [Usage Instructions] and replace source="pgb"
with source="npm"
.
If this fails, make use of "Option 3" on the comments above "Start Using NPM for PhoneGap" artice where you use the [Repository] link under [Other Details] on your PhoneGap Plugin page in your plugin like so:
<plugin spec=“https://github.com/apache/cordova-plugin-contacts.git” source=“git” />
I hope this saves a few people a couple of hours!
来源:https://stackoverflow.com/questions/40995204/phonegap-build-error-plugin-unsupported