Michael
Michael

Reputation: 13616

Why I get error when I upload zip file to phonegap service?

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="[email protected]" 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: [email protected] 

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

Upvotes: 1

Views: 263

Answers (2)

dotNetkow
dotNetkow

Reputation: 5313

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.

Upvotes: 1

user2098856
user2098856

Reputation: 34

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

Upvotes: 1

Related Questions