【问题标题】:Android Virtual Machine: Double Error: "Google Play Games not installed"Android 虚拟机:双重错误:“未安装 Google Play 游戏”
【发布时间】:2016-10-09 03:39:02
【问题描述】:

我现在正在创建一个游戏并尝试实现 Google Play Games SignIn。 我的问题是(我认为是)Google Play 游戏没有正确安装在虚拟机上。如果我启动应用程序,它会给我“未安装 Google Play 游戏”的响应(参见图片)。如果您单击“安装”或“取消”按钮,它将再次打开同一屏幕。我不知道为什么。没有显示错误。

Link to the Error Image

这是连接到登录系统的全部代码:

@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.d(TAG, "Connection Failed");

    if (mResolvingConnectionFailure) {
        // Already resolving
        return;
    }

    // If the sign in button was clicked or if auto sign-in is enabled,
    // launch the sign-in flow
    if (mSignInClicked || mAutoStartSignInFlow) {
        mAutoStartSignInFlow = false;
        mSignInClicked = false;
        mResolvingConnectionFailure = true;

        // Attempt to resolve the connection failure using BaseGameUtils.
        // The R.string.signin_other_error value should reference a generic
        // error string in your strings.xml file, such as "There was
        // an issue with sign in, please try again later."
    if (!BaseGameUtils.resolveConnectionFailure(this,
                mGoogleApiClient, connectionResult,
                RC_SIGN_IN, getResources().getString(R.string.signin_other_error))) {
            mResolvingConnectionFailure = false;
        }
    }

    // Put code here to display the sign-in button
}

public void onGoogleClick(View view){
    mSignInClicked = true;
    mGoogleApiClient.connect();
}

@Override
public void onConnected(Bundle connectionHint) {
    // show sign-out button, hide the sign-in button
    findViewById(R.id.sign_in_button).setVisibility(View.GONE);
    Log.d(TAG, "Connected");
    Games.Achievements.unlock(mGoogleApiClient, getResources().getString(R.string.ach_lvl3));

    // (your code here: update UI, enable functionality that depends on sign in, etc)
}

@Override
public void onConnectionSuspended(int i) {
    Log.d(TAG, "Connection Suspended");
}

以及 GoogleApiClient 声明

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this, this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Games.API).addScope(Games.SCOPE_GAMES)
            .build();

【问题讨论】:

    标签: android android-studio google-api google-play-games


    【解决方案1】:

    根据所附图片,Google Play 服务应用程序可能已过时。您只需要更新应用即可。

    转到 Google Play 并下载 Google Play services。希望对您有所帮助。

    【讨论】:

    • 唯一的问题是没有办法在avm上下载apk
    • 查看此SO thread for that,了解如何将 Google Play 安装到模拟器。
    【解决方案2】:

    查看Google Page on the topic

    简短版:

    • 确保在 AVD 管理器中更新某些 Google API
    • 为 AVD 选择“Google APIs x86 版本 NN”(NN 是您的目标)。

    不久前为我修复了地图——还有一些其他的小问题。问题是并非每个图像都安装了 Play 商店和/或特定的 Goog API,因此它们失败了。使用 Google API 可以确保两者都存在。

    HTH

    【讨论】:

    • 我只能找到包含 Google Play API 的 Android 版本。看起来他们没有更新,但在我的 SDK 管理器中一切似乎都正常
    【解决方案3】:

    好吧,结合其他想法。

    1. 在“Android SDK 管理器”中重新安装 Google API(在附加项下列出)。我不希望这能解决你的问题,只是覆盖基地。
    2. 我从未尝试过,但很多知识渊博的人推荐 Genymotion 作为调试的替代方案 - 虽然最近听起来 Play 服务已从他们的 AVD 中删除,says 他们仍然支持 play。

    希望你能尽快完成。

    【讨论】:

      猜你喜欢
      • 2016-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-28
      • 2019-07-08
      • 2015-10-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多