artberri / cordova-plugin-play-games-services

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

GameRequest doesn't exist #10

Open arthuro555 opened 4 years ago

arthuro555 commented 4 years ago

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.

ReDemoNBR commented 4 years ago

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

ReDemoNBR commented 4 years ago

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.+"
    },
  }
}
arthuro555 commented 4 years ago

Thanks for the workaround, but the plug-in should still be updated nontheless

princesanjivy commented 4 years ago

It worked! But it should be updated, so we don't get any probs in future when game is published in play.