Search code examples
androidcordovacordova-pluginsphonegap

Building phonegap app plugin error


I created a zip package from my app.

Then, I uploaded it to phonegap build to create the apk file I need.

In the output, I saw this:

Fetching plugin "cordova-plugin-geolocation" via npm Installing "cordova-plugin-geolocation" at "4.0.1" for android Plugin doesn't support this project's cordova-android version. cordova-android: 6.2.3, failed version requirement: >=6.3.0 Skipping 'cordova-plugin-geolocation' for android Fetching plugin

"cordova-plugin-inappbrowser" via npm Installing

"cordova-plugin-inappbrowser" at "2.0.2" for android Fetching plugin

"cordova-plugin-splashscreen" via npm Installing

"cordova-plugin-splashscreen" at "5.0.2" for android Fetching plugin

"cordova-plugin-whitelist" via npm Installing

"cordova-plugin-whitelist" at "1.3.3" for android version, you do not need this plugin since the whitelist will be built in. Fetching plugin "cordova-plugin-ios-longpress-fix" via npm

Installing "cordova-plugin-ios-longpress-fix" at "1.1.0" for android

Fetching plugin "cordova-plugin-statusbar" via npm Installing

"cordova-plugin-statusbar" at "2.4.1" for android Fetching plugin

"phonegap-plugin-push@2.0.0" via npm Installing "phonegap-plugin-push"

at "2.0.0" for android Subproject Path: CordovaLib Fetching plugin

"phonegap-plugin-barcodescanner" via npm Installing "phonegap-plugin-barcodescanner" at "7.0.2" for android Plugin doesn't support this project's cordova-android version. cordova-android: 6.2.3, failed version requirement: >=6.3.0 Skipping 'phonegap-plugin-barcodescanner' for android**

This is my confing.xml:

<widget id="com.devexpress.apptemplate" version="1.0" versionCode="1">
  <name>ApplicationTemplate</name>
  <description>Template</description>
  <author email="info@aaa.com" href="http://www.aaa.com/">aaaa</author>
  <preference name="permissions" value="none" />
  <preference name="prerendered-icon" value="true" />
  <preference name="phonegap-version" value="cli-7.0.1" />
  <preference name="android-windowSoftInputMode" value="adjustPan" />
  <preference name="SplashScreenDelay" value="60000" />
  <preference name="AutoHideSplashScreen" value="false" />
  <preference name="SplashShowOnlyFirstTime" value="false" />
  <preference name="FadeSplashScreen" value="false" />
  <preference name="ShowSplashScreenSpinner" value="false" />
  <preference name="DisallowOverscroll" value="true" />
  <preference name="StatusBarOverlaysWebView" value="false" />
  <preference name="StatusBarStyle" value="default" />
  <feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true" />
  </feature>
  <preference name="StatusBarBackgroundColor" value="#000000" />
  <preference name="android-minSdkVersion" value="15" />
  <preference name="android-targetSdkVersion" value="22" />
  <platform name="android">
    <resource-file src="google-services.json" target="google-services.json" />
  </platform>
  <platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
  </platform>
  <plugin name="cordova-plugin-geolocation" />
  <plugin name="cordova-plugin-inappbrowser" />
  <plugin name="cordova-plugin-splashscreen" onload="true" />
  <plugin name="cordova-plugin-whitelist" />
  <plugin name="cordova-plugin-ios-longpress-fix" />
  <plugin name="cordova-plugin-statusbar" onload="true" />
  <plugin name="phonegap-plugin-push" spec="2.0.0" />
  <plugin name="phonegap-plugin-barcodescanner" />
  <access origin="*" />
  <engine name="android" spec="^6.3.0" />

</widget>

I tried to add the last line to specify the android engine, but the output is the same. I'm using the phonegap version 7.0.1 and I prefer to keep it. Is there a way to reach my goal, keeping this phonegap version and adding the plugins I need [gps reader and barcode scanner]?


Solution

  • Try with this

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

    and for Barcode use this plugin

    <plugin spec="https://github.com/Telerik-Verified-Plugins/BarcodeScanner.git" source="git" >
        <param name="CAMERA_USAGE_DESCRIPTION" value="To scan barcodes." />
        </plugin>