gpt4 book ai didi

java - 定位 S+(版本 31 及更高版本)需要 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一

转载 作者:行者123 更新时间:2023-12-04 23:56:51 26 4
gpt4 key购买 nike

当我在 android 12 中启动我的应用程序时,它崩溃了,它给了我这个错误,
我的项目已经有了这个依赖

implementation 'androidx.work:work-runtime-ktx:2.7.1'
我更新了
implementation 'com.google.firebase:firebase-messaging-ktx:23.0.0'
firebase 消息传递库
我像这样在我的项目中使用了未决 Intent
    val pendingIntent = PendingIntent.getActivity(
applicationContext,
0,
intent,
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT // setting the mutability flag
)
错误 :
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.internal, PID: 11866
java.lang.IllegalArgumentException: com.internal: 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.chuckerteam.chucker.internal.support.NotificationHelper$transactionsScreenIntent$2.invoke(NotificationHelper.kt:47)
at com.chuckerteam.chucker.internal.support.NotificationHelper$transactionsScreenIntent$2.invoke(NotificationHelper.kt:19)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.chuckerteam.chucker.internal.support.NotificationHelper.getTransactionsScreenIntent(Unknown Source:2)
at com.chuckerteam.chucker.internal.support.NotificationHelper.show(NotificationHelper.kt:101)
at com.chuckerteam.chucker.api.ChuckerCollector.onRequestSent$com_github_ChuckerTeam_Chucker_library(ChuckerCollector.kt:65)
at com.chuckerteam.chucker.api.ChuckerInterceptor.intercept(ChuckerInterceptor.kt:111)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.android.core.helpers.interceptor.HeadersInterceptor.intercept(HeadersInterceptor.kt:41)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.android.core.helpers.AuthInterceptor.intercept(AuthInterceptor.kt:39)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
E/WebEngage: App has crashed
java.lang.IllegalArgumentException: com.internal: 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.

最佳答案

终于找到问题了
我有 chucker library我将它更新到最新版本并修复了

关于java - 定位 S+(版本 31 及更高版本)需要 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71361477/

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