GameRequest doesn't exist
Opened this issue · 4 comments
I cannot build my cordova app with this plugin. The error is that this plugin apparently uses an api that doesn't exist (anymore). The error:
Error: /worker/app-2321125f-8454-4860-9587-b826f03fd797/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;
^
/worker/app-2321125f-8454-4860-9587-b826f03fd797/platforms/android/app/src/main/java/com/berriart/cordova/plugins/GameHelper.java:174: error: cannot find symbol
ArrayList<GameRequest> mRequests;
^
symbol: class GameRequest
location: class GameHelper
/worker/app-2321125f-8454-4860-9587-b826f03fd797/platforms/android/app/src/main/java/com/berriart/cordova/plugins/GameHelper.java:492: error: cannot find symbol
public ArrayList<GameRequest> getRequests() {
^
symbol: class GameRequest
location: class GameHelper
/worker/app-2321125f-8454-4860-9587-b826f03fd797/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
I cannot find GameRequest on https://developers.google.com/android/reference/com/google/android/gms/games/package-summary too.
Just had the same problem and found that it was deprecated along with Google+ integrations. Can't build either.
Google Play Games Service docs using Wayback Machine: https://web.archive.org/web/20170715182309/https://developers.google.com/android/reference/com/google/android/gms/games/request/package-summary
deprecation notice: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
Found a way to fix it by forcing the versions of com.google.android.gms:play-services-games
to 17.+
and com.google.android.gms:play-services-plus
to 16.+
by changing the plugin variables in package.json
like below. This way, it still using the old libraries that still had the deprecated features
"cordova": {
"plugins": {
"cordova-plugin-play-games-services": {
"APP_ID": "<app_id>",
"ANDROID_PLAY_SERVICES_GAMES_VERSION": "17.+",
"ANDROID_PLAY_SERVICES_PLUS_VERSION": "16.+"
},
}
}
Thanks for the workaround, but the plug-in should still be updated nontheless
It worked! But it should be updated, so we don't get any probs in future when game is published in play.