1

I try to create apk file using phonegap service.

Here is my config.xml file in my project:

<?xml version='1.1' encoding='utf-8'?>
<widget id="il.co.geomind.gilgalplay" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>sites</name>
    <description>
        app for sites mapping
    </description>
    <author email="jacklondon@ddd.com" href="">

    </author>
    <content src="index.html" />
    <access origin="*" />
    <preference name="Orientation" value="portrait" />
    <preference name="permissions" value="none"/>

    <feature name="http://api.phonegap.com/1.0/camera"/>
    <feature name="http://api.phonegap.com/1.0/geolocation"/>

    <icon src="images/icons/ldpi.png" gap:platform="android" gap:qualifier="ldpi" />
    <icon src="images/icons/mdpi.png" gap:platform="android" gap:qualifier="mdpi" />
    <icon src="images/icons/hdpi.png" gap:platform="android" gap:qualifier="hdpi" />
    <icon src="images/icons/xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />
    <icon src="images/icons/xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" />
    <icon src="images/icons/xxxhdpi.png" gap:platform="android" gap:qualifier="xxxhdpi" />

    <!-- iPhone / iPod Touch  -->
    <icon src="images/icons/mdpi.png" gap:platform="ios" width="60" height="60" />
    <icon src="images/icons/xhdpi.png" gap:platform="ios" width="120" height="120" />

    <!-- Settings Icon -->
    <icon src="images/icons/ldpi.png" gap:platform="ios" width="29" height="29" />
    <icon src="images/icons/mdpi.png" gap:platform="ios" width="58" height="58" />

    <!-- Spotlight Icon -->
    <icon src="images/icons/ldpi.png" gap:platform="ios" width="40" height="40" />
    <icon src="images/icons/mdpi.png" gap:platform="ios" width="80" height="80" />

  <gap:platform name="android" />

  <gap:splash src="images/icons/screen-xhdpi.png"/>

  <gap:plugin name="cordova-plugin-whitelist" source="npm" />
  <gap:plugin name="org.apache.cordova.camera" version="0.3.6" source="npm" />
  <gap:plugin name="org.apache.cordova.device" version="0.3.0" source="npm"/>
  <gap:plugin name="com.phonegap.plugins.pushplugin" version="2.5.0" source="npm"/>
  <gap:plugin name="org.apache.cordova.geolocation" version="0.3.12" source="npm"/>

</widget>

I make zip file from the project and make upload to the phonegap service I get this error:

Error - The following plugin, plugin version or a dependancy of this plugin is not on npm: com.phonegap.plugins.pushplugin@2.5.0 

Any idea why I get error above and how to fix it?

Michael
  • 13,950
  • 57
  • 145
  • 288

2 Answers2

1

It looks like you are trying to use https://github.com/phonegap-build/PushPlugin, which appear to be deprecated and hasn't had a release in 2 years.

Looks like you should try https://github.com/phonegap/phonegap-plugin-push instead which is the replacement for it

  • Any idea how I use it? How and where do I reference in my project? – Michael Jun 05 '17 at 09:34
  • There is an example app for the plugin, which you can create from a template, so you might be best trying that: phonegap create my-app --template phonegap-template-push (https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/EXAMPLES.md) – user2098856 Jun 05 '17 at 09:39
  • can't I just install specific js files to my project and referance then in config.xml file.I already has a project I only need to create apk file ? – Michael Jun 05 '17 at 09:49
1

By setting the source to Node Package Manager (source="npm"), you're telling PhoneGap Build to retrieve the plugin from that location, but "com.phonegap.plugins.pushplugin, version 2.5.0" isn't actually there.

If we look on npmjs.com for the push plugin, there are two plugin search results but as mentioned in the other Answer, it hasn't been updated for over 2 years and is even labeled "-deprecated".

Assuming you want a push notification plugin, I recommend trying to find an official one. To do so, search for them by beginning with “cordova-plugin” coupled with whatever you’re looking for: "cordova-plugin-push". This led me to this one, which would probably work.

In your config.xml file, add a reference to it like so:

<plugin name="cordova-plugin-push-notification" version="2.5.2" source="npm" />

I used version 2.5.2 since that's the latest version:enter image description here

For further reference, see my guide on using NPM with PhoneGap Build.

dotNetkow
  • 5,053
  • 4
  • 35
  • 50