gpt4 book ai didi

android - exception.class.missing._Unknown_ : Strongly consider using FLAG_IMMUTABLE without PendingIntent in source

转载 作者:行者123 更新时间:2023-12-05 00:01:03 30 4
gpt4 key购买 nike

我最近将我的应用更新为以 API 31 为目标,并注意到 Google Play 控制台中报告了一个新的崩溃,这对我来说毫无意义。

The crash caused by exception.class.missing._Unknown_: Strongly consider using FLAG_IMMUTABLE... 在SO和其他地方有很多答案,但是从我读到的这个崩溃应该只与 PendingIntent 的使用有关。

崩溃报告是有道理的,因为我只看到在 Android 12 (API 31) 上报告的崩溃,因为这是引入显式 IMMUTABLE 或 MUTABLE 要求的地方,但我已经搜索了整个项目,但找不到任何使用 PendingIntent

崩溃的时间似乎与我发送的 FCM 推送通知有关,这又与来自 PendingIntent 的崩溃有关,但如果我在我的源中找不到它,那我怎么能我明确设置了 FLAG_IMMUTABLE?

我的项目依赖如下:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.4.0-beta01'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'

// billing for in-app purchases
implementation 'com.android.billingclient:billing:3.0.2'

// For in-app review flow
implementation 'com.google.android.play:core:1.10.2'

// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:26.1.1')
implementation 'com.google.firebase:firebase-messaging'

}

最佳答案

这是 Admob 的一个已知问题,如 https://developers.google.com/admob/android/quick-start 所述

androidx.work:work-runtime:2.1.0 pulled from play-services-ads has abug using PendingIntent without FLAG_IMMUTABLE or FLAG_MUTABLE andwill fail in apps targeting S+.

解决方法也有提到,在app/build-gradle文件中:

dependencies {
implementation 'com.google.android.gms:play-services-ads:20.4.0'

// For apps targeting Android 12, add WorkManager dependency.
constraints {
implementation('androidx.work:work-runtime:2.7.0') {
because '''androidx.work:work-runtime:2.1.0 pulled from play-services-ads
has a bug using PendingIntent without FLAG_IMMUTABLE or
FLAG_MUTABLE and will fail in apps targeting S+.'''
}
}
}

关于android - exception.class.missing._Unknown_ : Strongly consider using FLAG_IMMUTABLE without PendingIntent in source,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69797073/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com