Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

GoogleCloudMessaging error #604

Closed
furyscript opened this issue Feb 11, 2016 · 18 comments
Closed

GoogleCloudMessaging error #604

furyscript opened this issue Feb 11, 2016 · 18 comments

Comments

@furyscript
Copy link

When I installed this plugin for my Ionic projects I still have this error when I build apk.

/phonegap/push/RegistrationIntentService.java:30: error: cannot find symbol
                    GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
                                        ^
  symbol:   variable INSTANCE_ID_SCOPE
  location: class GoogleCloudMessaging

I have all requirements plugin.

@macdonst
Copy link
Member

@furyscript duplicate of #477 #424. Your Android build environment is not correct.

@furyscript
Copy link
Author

With version 1.3.0 works why? @macdonst

@macdonst
Copy link
Member

@furyscript because version 1.3.0 does no use the most up to date version of GoogleCloudMessaging. As of 1.4.x I switched to using gradle for the gcm dependency.

@furyscript
Copy link
Author

Ok thanks for anwser, sorry if I ask... But if I'm using last of version of this plugin, and last version of googleplayservices how can I resolve my issue?? I required both @macdonst

@macdonst
Copy link
Member

@furyscript sorry, are you saying you are using the latest googleplayservices plugin?

@furyscript
Copy link
Author

Yes last version of googleplayservices and last version of this plugin.
If I switch to phonegap-plugin-push 1.3.0 compilation works fine... @macdonst

@macdonst
Copy link
Member

@furyscript You misunderstood my question. Are you using this plugin?

https://www.npmjs.com/package/cordova-plugin-googleplayservices

@furyscript
Copy link
Author

I think yes, this is my package.json for cordova plugin. I'm using ionic. @macdonst
https://gist.github.com/anonymous/d51d0de09cdcb145c1c4

@macdonst
Copy link
Member

@furyscript yeah, don't do that. That is the old way of doing things. In fact the original plugin is deprecated see here:

https://github.com/MobileChromeApps/google-play-services

so you must be using the one from here:

https://github.com/floatinghotpot/google-play-services

this is a really bad idea as you can end up including the jar file twice and screwing up your app, like you are seeing.

Why do you need to use that plugin?

@furyscript
Copy link
Author

is required for google-admob-sdk, now I installed playservices plugin from floatinghotpot repository but I got an error with google-admob-sdk

Failed to install 'com.google.admobsdk':Error: Expected plugin to have ID "cordova-plugin-googleplayservices" but got "com.google.playservices".

This is new package.json @macdonst https://gist.github.com/anonymous/521394f9fcfe7c9c235d

@macdonst
Copy link
Member

@furyscript right, so this is not a bug with the phonegap-plugin-push package. You are using some outdated plugins. You should raises issues on those plugins to get them to fix the issues or move to a more up to date admob plugin like:

https://github.com/floatinghotpot/cordova-admob-pro

@furyscript
Copy link
Author

Ok at the moment I remove android admob plugin, but now I have this error :

> Error: more than one library with package name 'com.google.android.gms'

Same google play services of floatinghotpot include com.google.android.gms

@macdonst
Copy link
Member

@furyscript delete your platforms directory and start over.

@furyscript
Copy link
Author

Also not work, I run ionic state reset and ionic remove plaform android, ionic add platform android

@nibhatish
Copy link

I had the same error. Removing plugin cordova-plugin-googleplayservices solved my issue.

@furyscript
Copy link
Author

But I require cordova-plugin-googleplayservices

@ntkzwane
Copy link

ntkzwane commented Nov 10, 2016

Hi @furyscript did you find a resolve? I am experiencing the very same issue and also cannot afford to remove cordova-plugin-googleplayservices

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants