我有这样的代码:
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();它在第二行说"API“是不推荐的,但它并没有给我一些东西来代替。
如果我移除它,我就会得到
java.lang.IllegalArgumentException:必须调用addApi()来添加至少一个API
发布于 2018-04-22 12:32:31
这是访问Google 不受欢迎的整个方法,因此这些方法可能都已被废弃,以提示开发人员切换到较新的访问方法(1,2)。
长期的解决方案是用GamesClient替换当前代码。
https://stackoverflow.com/questions/49965707
复制相似问题