Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

compile problems with Android and the push notification plug-in

Ian_Ippolito
Beginner
1,511 Views

Hello,

I recently upgraded my project to the latest version of the xdk, which required moving from Cordova 3.5 to Cordova 5.1.1. This meant also updating the push notification third-party plug-in as well. The updated plug-in (https://github.com/phonegap/phonegap-plugin-push) compiles fine on the IOS build. But on android build it gives an error:

symbol:   method getAssets()
  location: class GCMIntentService
.../DevDollarCandy/platforms/android/src/com/adobe/phonegap/push/PushPlugin.java:72: error: cannot find symbol
                            token = InstanceID.getInstance(getApplicationContext()).getToken(senderID, GCM);
                                    ^
  symbol: variable InstanceID
.../DevDollarCandy/platforms/android/src/com/adobe/phonegap/push/PushPlugin.java:76: error: cannot find symbol
                            token = InstanceID.getInstance(getApplicationContext()).getToken(senderID, GCM);
                                    ^
  symbol: variable InstanceID
.../DevDollarCandy/platforms/android/src/com/adobe/phonegap/push/PushPlugin.java:132: error: cannot find symbol
                        InstanceID.getInstance(getApplicationContext()).deleteInstanceID();
                        ^
  symbol: variable InstanceID
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
23 errors
 FAILED

I noticed in the instructions for the plug-in, it has a special procedure for compiling with android.

Compiling

As of version 1.3.0 the plugin has been switched to using Gradle/Maven for building. You will need to ensure that you have installed the Android Support Library version 23 or greater, Android Support Repository version 20 or greater, Google Play Services version 27 or greater and Google Repository version 22 or greater.

However, since I don't know what the xdk does behind the scenes, I'm not certain if this is already being done, or if something is to be changed.

How do I go about resolving this error? Thanks.

0 Kudos
7 Replies
PaulF_IntelCorp
Employee
1,511 Views

Specify version 1.2.3 of the push plugin, the newest version won't work with out current build system. We expect to have a fix for this in the near future, for now you need to use this older version of the plugin.

0 Kudos
Ian_I_
Beginner
1,511 Views

Thanks for the information Paul.

I was trying out your suggestion of switching to version 1.2.3, but saw that there was no way to change the version with a dropdown (like I have seen on other plugins). Does this perhaps require changing a configuration file manually instead? Capture.JPG

0 Kudos
PaulF_IntelCorp
Employee
1,511 Views

Sorry, there's a bug in that plugin feed. Remove the plugin and add it as a third-party plugin with the following information:

I gave you the wrong version to use with CLI 4.1.2, use the settings I'm providing above. I will be fixing that feed mistake.

0 Kudos
Martin_B_1
Beginner
1,511 Views

Hi, Is there a solution for this when using Cordova CLI 5.1.1?

I am getting a build error when trying to use the latest version of the Phonegap Push plugin.

Build failed... plugin contains Gradle script.

Thanks for any help.

0 Kudos
PaulF_IntelCorp
Employee
1,511 Views

Martin, inspecting the git repo, it looks to me like version 1.4.3 is the last version to not include a gradle script. I would try that one.

However, I don't think that is the problem, our build system supports gradle, it just does not support "hook scripts" inside plugins. I think there is a conflict between this plugin and another plugin in your project. See this note in that plugin's repo: https://github.com/phonegap/phonegap-plugin-push/blob/2301364665ea5ec86f3e2d695321f0413e30d9e7/docs/INSTALLATION.md#multidex

0 Kudos
Martin_B_1
Beginner
1,511 Views

No, that seemed to fix it. I downgraded the version to 1.4.3 and the project built fine with Cordova CLI 5.1.1

Many thanks Paul!

0 Kudos
PaulF_IntelCorp
Employee
1,511 Views

Thank you, Martin.

I did some deeper investigation and those later versions of that plugin were incorrectly added to the featured list, since they will not work due to their gradle scripts. We do not support gradle scripts in plugins, only as part of the standard Android/Crosswalk build scripts. We will not support gradle scripts (and hook scripts) in plugins until we've implemented our "isolated" build system, which is necessary to protect against malicious gradle scripts introduced by third-party plugins.

0 Kudos
Reply