I have this code:
apiClient = new GoogleApiClient.Builder(this)
.addApi(Games.API)
.addScope(Games.SCOPE_GAMES)
.enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
Log.e(TAG, "Could not connect to Play games services");
finish();
}
}).build();
It says at the second line that "API" is deprecated but it doesn't give me something to use instead.
If I remove it, I get
java.lang.IllegalArgumentException: must call addApi() to add at least one API
This entire method of accessing Google APIs is deprecated so it may be that those methods have all been deprecated to prompt developers to switch to the newer access method (1, 2).
The long term solution is to replace your current code with code based on GamesClient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With