标签: google-play-services

如何检测是否从 Unity 安装了 Google Play 服务?

有些设备没有安装 Google Play 服务,所以我不能使用像 Google Play 游戏服务这样的 API。在 Unity 中,如何检测未安装 Play 服务,因此我必须跳过调用 GPGS?

我知道我需要调用GoogleApiAvailability.isGooglePlayServicesAvailable,但我需要从 C#调用。

c# android unity-game-engine google-play-services

1
推荐指数
1
解决办法
2386
查看次数

Google Play游戏服务:ERROR_NOT_AUTHORIZED,推出Beta时.[Unity3d] [GooglePlayGamServices]

Google Play游戏服务:SIGN_IN状态:ERROR_NOT_AUTHORIZED,在推出Beta版时.还有: -

W Auth    : [GetToken] GetToken failed with status code: UNREGISTERED_ON_API_CONSOLE
E TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE
Run Code Online (Sandbox Code Playgroud)

如果我直接从Unity构建和运行,一切正常.但是,当我推出测试版时,它会显示带有加载圈的登录谷歌绿色框(然后是帐户 - >选择测试版测试人员电子邮件),然后什么也没有.

使用: -

  • GooglePlayGamesPlugin-0.9.38a
  • 团结5.6.03
  • sdk组件更新了rev 40,rev 51

我做的事情: -

  1. 创建了一个新的应用程序谷歌播放控制台
  2. 添加apk,制作测试版,然后制作推出.
  3. 后来我在新的更新中添加了游戏服务,并推出了测试版.
  4. 注意 - 所有apk,rollout使用相同的密钥库和包名称.
  5. Google Play控制台 - >版本管理 - >应用签名:上传证书SHA1与Google API相同 - >项目 - > Android SHA1的客户端ID

玩游戏设置: -

  • Beta测试人员电子邮件:打开
  • 游戏保存数据:关闭
  • 测试电子邮件:添加电子邮件
  • 测试Alpha和Beta:都勾选(绿色)

以下日志:

05-23 12:55:44.400 28917 29002 I GamesNativeSDK: Auth operation started: SIGN IN

05-23 12:55:44.400 28917 29002 I …
Run Code Online (Sandbox Code Playgroud)

c# android google-play-services

1
推荐指数
1
解决办法
9176
查看次数

尽管gradle文件中有Google Play Services依赖项,但找不到融合的位置提供程序类

我的应用使用FusedLocationProviderApi来获取当前位置。我已经在允许我的应用程序模块的gradle文件中添加了允许应用程序使用Google Play服务的行:

compile 'com.google.android.gms:play-services-ads:11.0.2'
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试声明一个FusedLocationProvider变量时,它变成红色并且无法识别该类。我唯一的猜测是我可能应该导入该类,但我不知道具体如何。

android google-play-services fusedlocationproviderapi

1
推荐指数
1
解决办法
2445
查看次数

安装了Firebase的Android Studio 2.1.2无效

每当我尝试启动firebase时,总会出现这些错误

W/GooglePlayServicesUtil: Google Play services out of date.  Requires 11020000 but found 8489470
W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
E/FA: Discarding data. Failed to send app launch
E/FA: Failed to get app instance id
E/FA: Failed to send current screen to service
E/FA: Discarding data. Failed to send event to service
Run Code Online (Sandbox Code Playgroud)

我得到的是与Google Play服务相关的内容,但我无法弄清楚如何修复它,我正在运行Android Studio 2.1.2并且SDK中没有Google Play服务的更新

编辑:我的应用程序Gradle(我正在使用模拟器)

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"

    defaultConfig {
        applicationId "com.example.sc.voxcinemascamp"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    } …
Run Code Online (Sandbox Code Playgroud)

android firebase google-play-services

1
推荐指数
1
解决办法
8298
查看次数

如何在Android Studio中将Google Play服务仓库更新为上一版本?

我已经安装了Android Studio的最新版本2.3.3,它说没有找到更新.我在Play Services网站上看到最新版本从2017年9月开始是11.4.0.但是在我的系统上Android/sdk/extras/google/m2repository/com/google/android/gms/play-services,我从2017年6月开始看到我有最新的11.0.4.Android Studio在设置中说安装了Google Play服务,没有更新,修订版是45.如何将其更新到最新版本?

android google-play-services android-studio

1
推荐指数
1
解决办法
1311
查看次数

setViewForPopUp(查看)google api(11.6.0)google play登录

因此,当我实施登录时,谷歌播放登录的方式有变化,GoogleApiClient但是现在它与投掷有所不同,GoogleSignInClient我没有任何线索如何在用户登录或解锁成就时设置popupview.甚至在谷歌文档中对此没有很好的解释,所以任何人都知道它,请提前回复你的回答

//google variable
private static int RC_SIGN_IN = 9001;
private static final int RC_ACHIEVEMENT_UI = 9003;
GoogleApiClient googleApiClient;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

}

public void SignIn(View view) {
    GoogleSignInClient signInClient = GoogleSignIn.getClient(this,
            GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN);
    Intent intent = signInClient.getSignInIntent();
    startActivityForResult(intent, RC_SIGN_IN);
}

private void signInSilently() {
    GoogleSignInClient signInClient = GoogleSignIn.getClient(this,
            GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN);
    signInClient.silentSignIn().addOnCompleteListener(this,
            new OnCompleteListener<GoogleSignInAccount>() {
                @Override
                public void onComplete(@NonNull Task<GoogleSignInAccount> task) {
                    if (task.isSuccessful()) {
                        // The signed in account is stored in the …
Run Code Online (Sandbox Code Playgroud)

android google-play-services google-play-games

1
推荐指数
1
解决办法
546
查看次数

com.google.android.gms.common.api.ApiException:10

我正在尝试使用Google登录示例,但是它不起作用。我收到ApiException statusCode = 10

我使用与此处相同的代码 https://developers.google.com/identity/sign-in/android/

android google-play-services google-signin googlesigninaccount googlesigninapi

1
推荐指数
1
解决办法
3523
查看次数

无法导入com.google.android.gms:play-services-ads:17.1.1

apply plugin: 'com.android.application'
   android {
   compileSdkVersion 28

   defaultConfig {
      applicationId "com.kaiboon0216gmail.homeownerstarterkit"
      minSdkVersion 21
      targetSdkVersion 28
      versionCode 1
      versionName "1.0"
      testInstrumentationRunner 
      "android.support.test.runner.AndroidJUnitRunner"
    } 
    buildTypes {
       release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
    }
}


dependencies {
   implementation fileTree(dir: 'libs', include: ['*.jar'])
   implementation 'com.android.support:appcompat-v7:28.0.0'
   implementation 'com.android.support.constraint:constraint-layout:1.1.3'
   testImplementation 'junit:junit:4.12'
   androidTestImplementation 'com.android.support.test:runner:1.0.2'
   androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
   implementation 'com.android.support:cardview-v7:28.0.0'
   implementation 'com.google.android.gms:play-services-ads:17.1.1'
}
Run Code Online (Sandbox Code Playgroud)

这些是我的代码。我正在使用Admob在我的应用中显示广告。当我添加以下代码时:“ 'com.google.android.gms:play-services-ads:17.1.1'”并同步我的应用崩溃。

之后,我转到Admob官方网站,发现此版本适用于'com.android.support:appcompat-v7:26.1.0'版本。但是,当我将compileSdkVersion更改为26时,我的应用仍然崩溃。

我已经测试了没有以下代码的代码:“ 'com.google.android.gms:play-services-ads:17.1.1'”并且它可以运行。我确定此代码是问题所在,但我不知道如何改正它。

谁能帮助解决我的问题?谢谢。

java android admob google-play-services

1
推荐指数
1
解决办法
7984
查看次数

为什么gradle插件3.3.0不想构建Google服务?

我正在尝试与同步我的项目gradle:3.3.0,但是在文件values.xml夹中未生成google-services的结果文件:D:\Android\workspace\myproject\app\build\generated\res\google-services\debug\values\values.xml

顶级构建文件build.gradle

 apply plugin: 'kotlin'

    buildscript {
        ext.kotlin_version = '1.3.11'
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.3.0'
            classpath 'com.google.gms:google-services:4.1.0'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          }
    }

    allprojects {
        repositories {
            mavenLocal()
            google()
            jcenter()
            mavenCentral()
            maven { url "https://jitpack.io" }
        }

        configurations.all {
            exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jre7'
        }
    }

    dependencies {
        implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    }

    compileKotlin {
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
    compileTestKotlin {
        kotlinOptions {
            jvmTarget = "1.8"
        }
    } …
Run Code Online (Sandbox Code Playgroud)

android gradle firebase google-play-services android-gradle-plugin-3.3.0

1
推荐指数
1
解决办法
374
查看次数

同步错误:com.google.android.gms:play-services-base:17.2.0

同步我的项目时,我遇到了这个错误,我已经在网上搜索过,但是没有得到任何可以推动我前进的结果

错误

ERROR: Failed to resolve: com.google.android.gms:play-services-base:17.2.0
Run Code Online (Sandbox Code Playgroud)

以下是我的依赖

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
    }
}

    dependencies {
        implementation fileTree(dir: 'libs', include: '*.jar')
        // SUB-PROJECT DEPENDENCIES START
        implementation(project(path: ":CordovaLib"))
        implementation 'com.android.support:support-annotations:28.0.0'
        implementation 'com.android.support:support-v4:28.0.0'
        implementation 'com.android.support:support-v4:28.0.0'
        implementation 'com.android.support:support-v13:28.0.0'
        implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
        implementation 'com.google.firebase:firebase-core:17.2.0'
        implementation 'com.google.firebase:firebase-messaging:20.0.0'
        implementation 'com.google.android.gms:play-services-base:17.2.0'
        implementation 'com.google.android.gms:play-services-ads:18.2.0'

        // SUB-PROJECT DEPENDENCIES END
    }
Run Code Online (Sandbox Code Playgroud)

关于如何使其同步的任何解决方案?

android google-play-services android-gradle-plugin

1
推荐指数
1
解决办法
422
查看次数