Software Archive
Read-only legacy content
17061 Discussions

Phonegap Plugin Push versions and XDK CLI issues

madson_g_
Beginner
425 Views

After updating Intel XDK CLI from 6.2.0 to 6.5.0 and removed Phonegap Plugin Push v1.8.2 to install v2.0.0-rc5 from git repo I got the error below:

Uncaught ReferenceError: PushNotification is not defined

So I checked my backup project with plugin push version 1.8.2 and noticed that 

    "phonegap-plugin-push": {
        "SENDER_ID": "*************",
        "PACKAGE_NAME": "io.cordova.hellocordova"
    }

was missing in windows.json, android.json and ios.json. Only fetch.json contains

"phonegap-plugin-push": {
    "source": {
        "type": "git",
        "url": "https://github.com/phonegap/phonegap-plugin-push",
        "subdir": "."
    },
    "is_top_level": true,
    "variables": {
        "SENDER_ID": "***********"
    }
}

It looks like XDK CLI is not being completely efficient at installing it. I copied what was missing from my backup to the newest json´s and the error is not being displayed anymore

 

 

0 Kudos
4 Replies
madson_g_
Beginner
425 Views

Reading the building error log I noticed that cordova-android version is not ok.

Fetching plugin "https://github.com/phonegap/phonegap-plugin-push" via git clone
Using shallow clone
Repository "https://github.com/phonegap/phonegap-plugin-push" checked out to git ref "master" at "2a8e3df".
Installing "phonegap-plugin-push" at "2.0.0-rc5" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 6.1.2, failed version requirement: >=6.2.1
Skipping 'phonegap-plugin-push' for android

 

0 Kudos
madson_g_
Beginner
425 Views

I reinstalled v1.8.2 and push plugin error was solved. But building is still failing with CLI 6.5.0. Back to CLI 6.2.0 it works.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 8.636 secs
Error: /project/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.

 

0 Kudos
PaulF_IntelCorp
Employee
425 Views

Where are you seeing these messages? From the XDK during a "plugin add" operation? From PhoneGap Build? From Cordova CLI?

I am able to add that plugin to a project using the Plugin Management tool (I used the NPM method to retrieve and install the plugin). It allowed the add to happen, despite the fact that the CLI within the XDK is actually 6.2.0.

Are you building with PhoneGap Build or with Cordova CLI?

p.s. I would not use the 2.0 version of that plugin, those versions are all "release candidates," thus the "rc" version number suffix. They are likely not ready for "prime time." Instead, use the NPM method to install version 1.10.5 by specifying it like the following:

Screen Shot 2017-07-12 at 15.05.18 .png

Screen Shot 2017-07-12 at 15.04.53 .png

 

0 Kudos
madson_g_
Beginner
425 Views

Ok I see that log when I use the adobe phonegap website to build it.

About the plugin:

The installation is always successful, even using git repo tab. It just doesn't add it to that json's files. It has to be done manually. What doesn't happen with v1.8.

About the building:

It fails with the new cli 6.5. These errors only occur after update cli from 6.2 to 6.5 in xdk, despite the usage of the plugin or not. I had to return to cli 6.2 to build it successfully.

0 Kudos
Reply