█ 【安卓学习之常见问题】google play service


█ 系列文章目录

提示:这里是收集了安卓学习之常见问题的相关文章


█ 文章目录


█ 读前说明

  • 本文通过学习别人写demo,学习一些课件,参考一些博客,’学习相关知识,如果涉及侵权请告知
  • 本文只简单罗列相关的代码实现过程
  • 涉及到的逻辑以及说明也只是简单介绍,主要当做笔记,了解过程而已
  • 如需运行使用最新版 Google Play 服务的应用,您需要安装了 Play 商店应用的设备并且必须登录 Google 帐号   
    下载:两款谷歌安装工具加一个长鹅教育加速器

█ 问题:您的设备不支持Google Play 服务

⚡️ 1.您的设备不支持Google Play 服务,因此无法运行 【app应用名称】;
这个是地图自带提示的,也就是说你要安装下谷歌三件套

LocationServices.getFusedLocationProviderClient(context).requestLocationUpdates()
OnFailureListener()
Status{statusCode=API: LocationServices.API is not available on this device., resolution=null}

在这里插入图片描述

public class GooglePlayServicesUtilLight {
    private static int zza(Context var0, boolean var1, int var2) {
        Preconditions.checkArgument(var2 >= 0);
        PackageManager var3 = var0.getPackageManager();
        PackageInfo var4 = null;
        if (var1) {
            try {
            	// 包名为com.android.vending,app名称为Google Play 商店
            	// 8256:0x2040 (MATCH_UNINSTALLED_PACKAGES/GET_UNINSTALLED_PACKAGES | GET_SIGNATURES) 
            	// MATCH_UNINSTALLED_PACKAGES:返回 保留了应用数据(含已卸载)的应用 (判断是否第一次安装)
            	// GET_SIGNATURES 返回签名信息
                var4 = var3.getPackageInfo("com.android.vending", 8256);
            } catch (NameNotFoundException var12) {
                Log.w("GooglePlayServicesUtil", "Google Play Store is missing.");
                return 9;// ConnectionResult.SERVICE_INVALID  【Google Play 商店】没安装
            }
        }
        。。。。。。
    }
}

⚡️ 2.安装 GO谷歌安装器,一键安装 谷歌服务框架、谷歌账号管理、谷歌play服务、谷歌市场等组件。
如:GoPlay工作室出品的 GO安装器 4.8.6 (安装需要xxx官网(访问不了)

在这里插入图片描述

█ 问题(真机):google play service are updating

⚡️ 1.安装了谷歌服务后,出现了另一个问题,google play service are updating

LocationServices.getFusedLocationProviderClient(context).requestLocationUpdates()
OnSuccessListener()
LocationCallback.onLocationAvailability(LocationAvailability)
LocationAvailability[isLocationAvailable: false]

在这里插入图片描述

public class GoogleApiAvailabilityLight {
	// var2:GOOGLE_PLAY_SERVICES_VERSION_CODE = 12451000
    public int isGooglePlayServicesAvailable(Context var1, int var2) {
        int var3 = GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(var1, var2);
        if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(var1, var3)) {
            var3 = 18;// ConnectionResult.SERVICE_UPDATING
        }

        return var3;
    }
}

⚡️ 2.知乎上说清缓存或者升级到【12.6.85】就可以解决,我都是21版本了,测试了没有效果,可能是手机不支持
在这里插入图片描述

PS1:2018-05-23 遇到google play service are updating 该如何处理?已无法使用uber? - 知乎

█ 问题(模拟器):显示 google标记,显示地图,可定位

⚡️ 1.雷电模拟器自带的谷歌安装器,测试下:显示 google标记,不显示地图,大部分不可以定位,有测试过一次 可以定位(重启app可以定位,重启模拟器后,又不能定位)

成功(可能触发了什么东西)失败(正常都无法定位)
LocationServices.getFusedLocationProviderClient(context).requestLocationUpdates()
OnSuccessListener()
LocationCallback.onLocationResult(LocationResult)
LocationResult[locations: [Location[fused 39.915001,116.404000 acc=0 et=+3h24m30s774ms alt=0.0 vel=0.02038 bear=0.0 {Bundle[mParcelledData.dataSize=52]}]]]
LocationCallback.onLocationAvailability(LocationAvailability)
LocationAvailability[isLocationAvailable: true]
LocationCallback.onLocationAvailability(LocationAvailability)
LocationAvailability[isLocationAvailable: false]

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

⚡️ 2.刚开始以为是地图放大导致,测试将地图缩小,也是一样
⚡️ 3.打开google play商店提示:[There was a problem communicating with Google Servers]

在这里插入图片描述

⚡️ 4.打开xxx软件,就可以显示地图(之前连接其他节点有问题,所以显示不了地图)
在这里插入图片描述
在这里插入图片描述

PS1:2020-06-10 雷电模拟器4.0版本支持谷歌商店吗? - 雷电安卓模拟器
PS2:与 Play 商店中的 Google 服务器通信时出现问题

█ 问题(真机):显示 google标记,显示地图,无法定位

⚡️ 1.上次安装谷歌服务后,提示 google play service are updating,但是模拟器可以,那么就是安装的谷歌服务有问题,于是重写卸载掉,重新安装:(多安装了3个,版本比较低,不用xxx,安装完后,需要重启手机,才有效果)
在这里插入图片描述
⚡️ 2.此时手机也可以显示 google标记,没显示地图,不过无法定位;
在这里插入图片描述
⚡️ 3.打开xxx软件,就可以显示地图;测试的结果还是和之前一样:

LocationServices.getFusedLocationProviderClient(context).requestLocationUpdates()
OnSuccessListener()
LocationCallback.onLocationAvailability(LocationAvailability)
LocationAvailability[isLocationAvailable: false]

在这里插入图片描述

█ getToken() -> NETWORK_ERROR

⚡️ 1.NETWORK_ERROR:

com.android.vending E/PlayCommon: [123] alhz.k(134): Failed to connect to server for server timestamp: javax.net.ssl.SSLHandshakeException: SSL handshake aborted: ssl=0xc7d0be40: I/O error during system call, Connection reset by peer
com.android.vending E/Finsky: [138] moq.a(8): Failed to get auth token
    com.android.volley.AuthFailureError: Error while retrieving auth token
com.android.vending E/Finsky: [106] tud.i(-1): Failed to registerSync with Phenotype for experiment package com.google.android.finsky.stable.
    java.util.concurrent.ExecutionException: com.google.android.libraries.phenotype.client.api.PhenotypeRuntimeException: 29504: 29504: Could not find valid auth token for all requested accounts
com.google.android.gms.persistent E/WakeLock: GCM_HB_ALARM release without a matched acquire!
com.google.android.gms.persistent E/WakeLock: GCM_CONN_ALARM ** IS FORCE-RELEASED ON TIMEOUT **
com.google.android.gms.persistent E/AuthPII: [GoogleAccountDataServiceImpl] getToken() -> NETWORK_ERROR. Account: Account {name=*******gg@gmail.com, type=com.google}, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/emeraldsea.mobileapps.doritos.cookie
    utm: Error when calling server.

在这里插入图片描述
在这里插入图片描述

⚡️ 2.xxx问题:

2021-07-05 11:21:32.974 2129-2270/com.android.vending I/PlayCommon: [123] alhz.k(22): Preparing logs for uploading
2021-07-05 11:21:32.977 2129-2270/com.android.vending I/PlayCommon: [123] alhz.k(167): Connecting to server: https://play.googleapis.com/play/log?format=raw&proto_v2=true
2021-07-05 11:21:33.394 2129-2270/com.android.vending I/PlayCommon: [123] alhz.k(199): Successfully uploaded logs.

在这里插入图片描述


█ 相关资料

提示:这里是参考的相关文章

  1. 2018-05-23 遇到google play service are updating 该如何处理?已无法使用uber? - 知乎
  2. 2020-06-10 雷电模拟器4.0版本支持谷歌商店吗? - 雷电安卓模拟器
  3. There was a problem communicating with Google Servers in Play Store 与 Play 商店中的 Google 服务器通信时出现问题
  4. 2018-10-20 解决“你的设备不支持Google Play服务”而无法运行App的问题_牛八少爷的专栏-CSDN博客
  5. 2019-03-22 谷歌框架怎么样装?【红米note7pro吧】_百度贴吧
  6. 2021-03-24 location-samples-LocationUpdates
  7. 请求位置信息更新 | Android 开发者 | Android Developers

█ 免责声明

博主分享的所有文章内容,部分参考网上教程,引用大神高论,部分亲身实践,记下笔录,内容可能存在诸多不实之处,还望海涵,本内容仅供学习研究使用,切勿用于商业用途,若您是部分内容的作者,不喜欢此内容被分享出来,可联系博主说明相关情况通知删除,感谢您的理解与支持!

提示:转载请注明出处:
https://blog.csdn.net/ljb568838953/article/details/118405414

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐