简体   繁体   English

安全检测返回错误“需要更新套件”

[英]Safety Detect returns error "need update kit"

I have a problem with Safety Detect SDK.我对安全检测 SDK 有疑问。 When I'm trying to generate token I've got error from SDK that I need to update kit.当我尝试生成令牌时,我从 SDK 收到错误,我需要更新套件。 Error code is 1212. I've checked on webpage https://developer.huawei.com/consumer/en/doc/development/hmscore-common-References/error-code-0000001050045846 that I need to update it in App Gallery but In App Gallery I don't have any updates.错误代码是 1212。我在网页https://developer.huawei.com/consumer/en/doc/development/hmscore-common-References/error-code-0000001050045846上检查了我需要在 App Gallery 中更新它,但是在 App Gallery 中,我没有任何更新。 I've tried on two same phones (P40 lite) and error occures only on one of them.我在两部相同的手机(P40 lite)上进行了尝试,并且仅在其中一部上发生错误。 They have same version of HMS Core (6.6.0.332), same version of OS (Android 12).它们具有相同版本的 HMS Core (6.6.0.332),相同版本的操作系统 (Android 12)。 I though it was combined with push-kit but I've updated agcp library with version 1.6.0.300 and push kit with version 6.5.0.300 without any luck.我虽然它与 push-kit 结合使用,但我已经更新了版本 1.6.0.300 的 agcp 库和版本 6.5.0.300 的推送工具包,但没有任何运气。 Maybe someone had the same problem with some other kits.也许有人对其他一些工具包有同样的问题。 Code which I'm using to generate token is pased below:我用来生成令牌的代码如下:

String appId = AGConnectServicesConfig.fromContext(cordova.getContext()).getString("client/app_id");
  SafetyDetectClient mClient = SafetyDetect.getClient(getApplicationContext());
  Task<SysIntegrityResp> task = mClient.sysIntegrity(nonce.getBytes(StandardCharsets.UTF_8), appId);
  task.addOnSuccessListener(response -> {
    Log.i(TAG, "Success getting token");
  }).addOnFailureListener(e -> {
    if (e instanceof ApiException) {
      ApiException apiException = (ApiException) e;
      Log.e("SysIntegrity", "Error: " + SafetyDetectStatusCodes.getStatusCodeString(apiException.getStatusCode()) + ": " + apiException.getMessage());
    
    } else {
      Log.e("SysIntegrity", "ERROR:" + e.getMessage());
    }
  });

I'll be very glad if someone could point me where I could update that.如果有人能指出我可以更新的地方,我会很高兴。

Error code 1212 indicates that the subapplication of the HMS Core needs to be upgraded.错误码1212表示HMS Core的子应用需要升级。 The possible cause is that the Safety Detect apk is not installed or updated on your test device due to network or other reasons.可能的原因是由于网络或其他原因,您的测试设备上没有安装或更新 Safety Detect apk。 Can you please help to collect more logs to us to analyze?你能帮忙收集更多的日志给我们分析吗?

You can refer to the following command to collect log:您可以参考以下命令收集日志:

1) After adb is connected to the phone, execute the following commands: a) adb shell setprop log.tag.hwpush VERBOSE b) adb logcat -v threadtime 1> D:\hwSafetyDetect.log 1) adb 连接手机后,执行以下命令: a) adb shell setprop log.tag.hwpush VERBOSE b) adb logcat -v threadtime 1> D:\hwSafetyDetect.log

2) Reproduce the problem scene. 2)重现问题场景。

3) Press "Ctrl+C" to finish. 3) 按“Ctrl+C”完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM