artberri / cordova-plugin-play-games-services

Cordova Plugin For Google Play Game Service
39 stars 32 forks source link

Error on building apk using cordova #7

Closed faridmv closed 4 years ago

faridmv commented 4 years ago

Hi @artberri,

I just tried to build my project recently but I get errors as below:

`E:\phonegap\f2048\platforms\android\app\src\main\java\com\berriart\cordova\plugins\GameHelper.java:43: error: package com.google.android.gms.games.request does not exist import com.google.android.gms.games.request.GameRequest; ^ E:\phonegap\f2048\platforms\android\app\src\main\java\com\berriart\cordova\plugins\GameHelper.java:174: error: cannot find symbol ArrayList mRequests; ^ symbol: class GameRequest location: class GameHelper E:\phonegap\f2048\platforms\android\app\src\main\java\com\berriart\cordova\plugins\GameHelper.java:492: error: cannot find symbol public ArrayList getRequests() { ^ symbol: class GameRequest location: class GameHelper E:\phonegap\f2048\platforms\android\app\src\main\java\com\berriart\cordova\plugins\GameHelper.java:714: error: cannot find symbol mRequests = Games.Requests ^ symbol: variable Requests location: class Games Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 4 errors

Task :app:compileReleaseJavaWithJavac FAILED`

Please tell me what should I do?

Regards

brunolalande commented 4 years ago

This is because of a recent change in Google Play Services API which deprecated a bunch of classes. You need to stick to 18.0.1:

cordova plugin add cordova-plugin-play-games-services --variable APP_ID=<...> --variable ANDROID_PLAY_SERVICES_GAMES_VERSION=18.0.1

faridmv commented 4 years ago

This is because of a recent change in Google Play Services API which deprecated a bunch of classes. You need to stick to 18.0.1:

cordova plugin add cordova-plugin-play-games-services --variable APP_ID=<...> --variable ANDROID_PLAY_SERVICES_GAMES_VERSION=18.0.1

Thanks a lot @brunolalande this resolved my problem.