导致getGoogleAppId的Android Wear应用失败,并显示状态错误 [英] Android Wear app resulting in getGoogleAppId failed with status error

查看:191
本文介绍了导致getGoogleAppId的Android Wear应用失败,并显示状态错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Android Wear应用程序在我的Moto360上运行良好。它可以在Google管理控制台中访问Google Play服务和GCM API。然后我试着用另一只手表(LG G Watch)。因为我只能随手机配对一只手表,所以为了配合LG G Watch,我必须忘记moto360。现在我似乎无法连接到Google App API(GCM或播放服务)。我收到以下错误消息:

pre $ I $ G $ C $ I $ / $ G $ (2746):getGoogleAppId失败,状态为10
E / GMPM(2746):无法上传。应用程序测量被禁用

手表和随行移动应用程序的logcat中都会出现此错误。我试图查找什么状态代码,但无法找到任何信息。任何人都可以帮忙收集这个状态码是什么意思?

解决方案

替换 addApi with addApiIfAvailable

  mGoogleApiClient = new GoogleApiClient.Builder(this) 
.addApiIfAvailable(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(本)
.addOnConnectionFailedListener(本)
.build();


I have an Android Wear app which was working fine on my Moto360. It access Google Play Services and GCM APIs in the Google Admin console. Then I tried to use another watch (LG G Watch). Because I can only pair one watch at any time with my phone, I had to "forget" the moto360 in order to pair with the LG G Watch. Now I cannot seem to connect to Google App API (GCM or play services). I am getting the following error:

I/GMPM    ( 2746): App measurement is starting up
E/GMPM    ( 2746): getGoogleAppId failed with status: 10
E/GMPM    ( 2746): Uploading is not possible. App measurement disabled

This error occurs in the logcat of both the watch and the accompanying mobile app. I tried looking up what the status code but could not find any info. Could anyone please help in gleaning what this status code mean?

解决方案

Replace addApi with addApiIfAvailable

mGoogleApiClient = new GoogleApiClient.Builder(this)                     
                    .addApiIfAvailable(Drive.API)
                    .addScope(Drive.SCOPE_FILE)
                    .addConnectionCallbacks(this)
                    .addOnConnectionFailedListener(this)
                    .build();

这篇关于导致getGoogleAppId的Android Wear应用失败,并显示状态错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆