cranberrygame / cordova-plugin-game

Other
27 stars 33 forks source link

Cannot build with plugin installed: error: cannot find symbol #13

Open Peter-Maguire opened 8 years ago

Peter-Maguire commented 8 years ago
:compileReleaseJavaWithJavacX:\prod\platforms\android\src\com\cran  
berrygame\cordova\plugin\game\Game.java:18: error: cannot find symbol
import com.google.android.gms.common.GooglePlayServicesUtil;    
                                    ^
  symbol:   class GooglePlayServicesUtil  
  location: package com.google.android.gms.common  
X:\prod\platforms\android\src\com\google\example\games\basegameuti  
ls\GameHelper.java:34: error: cannot find symbol  
import com.google.android.gms.common.GooglePlayServicesUtil;  
                                    ^  
  symbol:   class GooglePlayServicesUtil  
  location: package com.google.android.gms.common  
X:\prod\platforms\android\src\com\cranberrygame\cordova\plugin\gam  
e\Game.java:76: error: cannot find symbol  
        if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this.cordova.ge  
tActivity()) != 0) {  
            ^  
  symbol:   variable GooglePlayServicesUtil  
  location: class Game  
X:\prod\platforms\android\src\com\google\example\games\basegameuti  
ls\GameHelper.java:963: error: cannot find symbol  
                errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode,
                              ^
  symbol:   variable GooglePlayServicesUtil
  location: class GameHelper```
mobilino commented 8 years ago

Hi,

I have the same problem. I think it is because GooglePlayServicesUtil is deprecated and not included anymore. GoogleApiAvailability is supposed to be used instead. This post explains how: http://stackoverflow.com/questions/31016722/googleplayservicesutil-vs-googleapiavailability

Could you update the plugin and push it to npm?

/Christof

pahayah commented 8 years ago

Got the same problem here. Would be great to get the fixed updated soon!

Thanks!

cranberrygame commented 8 years ago

@UnacceptableUse @mobilino @pahayah

Hi

Weired I have no build error (in cordova cli 5.1.1)

Not sure what is problem.

Thanks Sang Ki Kwon

mobilino commented 8 years ago

Hi cranberrygame,

thanks for looking into this. I guess that we all are building with slightly different settings/environments/tools. Hence I feel that eliminating the deprecated GooglePlayServicesUtil is a sound solution. Above I posted a link that might be a good start.

/Christof

Peter-Maguire commented 8 years ago

I'd be willing to bet all of the affected are using another plugin that uses google play services, hence the conflict.

shady786 commented 8 years ago

@UnacceptableUse @mobilino @pahayah @cranberrygame

I experience the same issue when building with this plugin. I doubt it's a conflict since I don't use any other plugin that has a play services dependency. The other plugins I have installed are : cordova-plugin-device 1.1.1 "Device" cordova-plugin-dialogs 1.2.0 "Notification" cordova-plugin-file 4.1.1 "File" cordova-plugin-game-center 0.4.2 "Game Center" cordova-plugin-inappbrowser 1.2.1 "InAppBrowser" cordova-plugin-media 2.1.0 "Media" cordova-plugin-splashscreen 3.1.0 "Splashscreen" cordova-plugin-vibration 2.1.0 "Vibration" cordova-plugin-whitelist 1.2.1 "Whitelist"

Worth noting this was after an update to cordova 6.0.0. Have not reverted back and tried an older version. Some random poking suggests a invalid dependency in the generated gradle file, a checkover is definitely required.

cranberrygame commented 8 years ago

@UnacceptableUse @mobilino @pahayah @shady786

Fixed this issue. Thanks Sang Ki Kwon

mobilino commented 8 years ago

Hi,

could you eliminate the import com.google.android.gms.common.GooglePlayServicesUtil; from GameHelper.java too?

/Christof

cranberrygame commented 8 years ago

@mobilino

Eliminated GooglePlayServicesUtil from GameHelper.java

Thanks Sang Ki Kwon

mobilino commented 8 years ago

Thanks, Sang!!

hanrock commented 8 years ago

I'm getting this error! but with GoogleApiAvailability!

error

PS: this error shows up when i try to run with admobpro plugin!

Any suggestions?

cwmahan commented 8 years ago

+1 on the GoogleApiAvailability build issue. Any updates?

cleverocheck commented 3 years ago

+1 on build issue. I came to this plugin from https://github.com/artberri/cordova-plugin-play-games-services, since the input-output-input-output chain does not work there (after it stops entering), and here is the problem with starting the software In fact, with a clean cordova project of a stable version at the time of writing the comment, I tried other plugins for Google Play, but they are either not completed at all (either the logout is not done in principle, just the TODO in the code weighs on this, then something else is not completed yet). In general, writing games using cordova is not an easy task.