【问题标题】:CRASH on Android 12 while using Huawei app service dependency, with build tools 31使用华为应用服务依赖项时在 Android 12 上崩溃,使用构建工具 31
【发布时间】:2021-12-13 15:10:37
【问题描述】:

我们已经实现了

"com.huawei.hms:appservice:$huaweiAppService" WHERE huaweiAppService = '6.1.0.301'

还有一个崩溃:

java.lang.IllegalArgumentException: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
    at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
    at android.app.PendingIntent.getActivity(PendingIntent.java:444)
    at android.app.PendingIntent.getActivity(PendingIntent.java:408)
    at com.huawei.hms.api.b.getErrPendingIntent(HuaweiApiAvailabilityImpl.java:10)
    at com.huawei.hms.common.internal.BaseHmsClient.resolution(BaseHmsClient.java:3)
    at com.huawei.hms.common.internal.BaseHmsClient.checkAvailabilityAndConnect(BaseHmsClient.java:34)
    at com.huawei.hms.common.internal.BaseHmsClient.connect(BaseHmsClient.java:1)
    at com.huawei.hms.common.internal.HuaweiApiManager$ConnectionManager.connect(HuaweiApiManager.java:21)
    at com.huawei.hms.common.internal.HuaweiApiManager$ConnectionManager.sendRequest(HuaweiApiManager.java:24)
    at com.huawei.hms.common.internal.HuaweiApiManager.connectAndSendRequest(HuaweiApiManager.java:8)
    at com.huawei.hms.common.internal.HuaweiApiManager.handleMessage(HuaweiApiManager.java:7)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.os.HandlerThread.run(HandlerThread.java:67)

我注意到一些华为服务已经有与问题相关的更新。所以我问的是appservice。

【问题讨论】:

    标签: android huawei-mobile-services huawei-developers


    【解决方案1】:

    感谢您的反馈,此问题是已知问题。研发团队将在11 月中旬发布新的固定版本,我会更新此答案并在发布时通知您。

    【讨论】:

      【解决方案2】:

      通过添加 huaweiBase transition 依赖 和 appService 依赖暂时解决了问题。

      它在后台更新了 appServiceLibrary 的一些来源,看起来像是临时修复。在不久的将来,我将删除此基础依赖项并将 appService 更新为更新。

      huaweiBase = '6.2.0.300'
      huaweiAppService = '6.1.0.301'
      
      huaweiDependencies = [
            huaweiBase: "com.huawei.hms:base:$huaweiBase",
            appService: "com.huawei.hms:appservice:$huaweiAppService"
      ]
      
          
      implementation huaweiDependencies.huaweiBase
      implementation huaweiDependencies.appService
      

      【讨论】:

        猜你喜欢
        • 2021-11-12
        • 2014-09-07
        • 2021-11-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-12-08
        相关资源
        最近更新 更多