반응형
Floating Firebase Messaging Crash Targeting S+(버전 31 이상)에는 FLAG_IMTOUBLE 중 하나가 필요합니다
최근 Firebase Messaging(보류 중)에서 더 많은 충돌(안드로이드 OS 12 사용자만)이 보고된 안드로이드 애플리케이션 대상을 31개로 출시했습니다의도). 응용 프로그램이 알림에서 일시 중지/백그라운드 상태일 때 충돌을 수신합니다. 가능한 해결책을 찾아봤지만 여전히 운이 따르지 않는다. 내가 이해한 바로는 우리는 보류 중을 추가해야 한다Intent.Flag_Imtable on Pending활동을 시작하려고 하지만 이 작업을 추가하거나 수정하는 방법을 전혀 알지 못합니다.
만약 누군가가 동일한 문제에 직면하여 해결했다면. 이에 대한 솔루션을 공유하십시오.
잘부탁드립니다...
dependencies{
implementation platform('com.google.firebase:firebase-bom')
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-iid'
implementation 'com.google.firebase:firebase-analytics:17.4.4'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
}
E/AndroidRuntime( 7058): java.lang.IllegalArgumentException: com.package: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/AndroidRuntime( 7058): 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.
E/AndroidRuntime( 7058): at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
E/AndroidRuntime( 7058): at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
E/AndroidRuntime( 7058): at android.app.PendingIntent.getActivity(PendingIntent.java:444)
E/AndroidRuntime( 7058): at android.app.PendingIntent.getActivity(PendingIntent.java:408)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.CommonNotificationBuilder.createContentIntent(com.google.firebase:firebase-messaging@@20.3.0:125)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo(com.google.firebase:firebase-messaging@@20.3.0:27)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.CommonNotificationBuilder.createNotificationInfo(com.google.firebase:firebase-messaging@@20.3.0:9)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.DisplayNotification.handleNotification(com.google.firebase:firebase-messaging@@20.3.0:27)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(com.google.firebase:firebase-messaging@@20.3.0:65)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(com.google.firebase:firebase-messaging@@20.3.0:44)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(com.google.firebase:firebase-messaging@@20.3.0:27)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(com.google.firebase:firebase-messaging@@20.3.0:17)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(com.google.firebase:firebase-messaging@@20.3.0:43)
E/AndroidRuntime( 7058): at com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run(Unknown Source:6)
E/AndroidRuntime( 7058): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime( 7058): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime( 7058): at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.6.0:2)
E/AndroidRuntime( 7058): at java.lang.Thread.run(Thread.java:920)
W/CrashlyticsCore( 7058): Cannot send reports. Settings are unavailable.
D/TransportRuntime.SQLiteEventStore( 7058): Storing event with priority=HIGHEST, name=FIREBASE_CRASHLYTICS_REPORT for destination cct
공식 문서 ""에 따르면
Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(context,NOTIFICATION_REQUEST_CODE, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
우리는 앱을 열 수 있는 표준 유형의 인텐트를 구성하고 있으며, 보류 중인 상태로 포장합니다알림에 추가하기 전 의도입니다.이 경우, 수행하고자 하는 정확한 작업이 있으므로 보류 중인 작업을 구성합니다라는 플래그를 사용하여 전달하는 앱에서 수정할 수 없는 의도입니다
나는 마침내 이것을 해결했다. 파이어베이스 플러그인의 낮은 버전 때문에 충돌했고 안드로이드 의존성과 플래터 플러그인을 업그레이드한 후 해결되었다.
1단계: Android/app/build.gradle에서
부터
implementation 'com.google.firebase:firebase-messaging:20.1.5'
로.
implementation platform('com.google.firebase:firebase-bom') // add this
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.firebase:firebase-iid:21.1.0' // add this
2단계: Float pubspec.yaml
부터
firebase_core: ^0.5.0+1
firebase_messaging: ^7.0.3
firebase_remote_config: ^0.4.2
firebase_crashlytics: ^0.1.4+1
firebase_dynamic_links: ^0.6.3
firebase_auth: ^0.18.4+1
로.
firebase_core: ^1.10.0
firebase_messaging: ^11.2.6
firebase_remote_config: ^2.0.0
firebase_crashlytics: ^2.5.0
firebase_dynamic_links: ^4.0.5
firebase_auth: ^3.3.6
갱신하다
부터
implementation 'com.google.firebase:firebase-messaging:20.1.5'
로.
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.firebase:firebase-iid:21.1.0'
및 Gradle Files와 프로젝트 동기화
반응형
'개발하자' 카테고리의 다른 글
유형 스크립트: 트리의 상위 레벨에서 한 모듈에 별칭을 지정할 수 있지만 다른 모듈에는 별칭을 지정할 수 없습니까? (0) | 2023.05.10 |
---|---|
Kubernetes 클러스터의 WebRTC (0) | 2023.05.09 |
Terraform에서 오류가 발생함 플러그인 스키마를 로드하지 못했습니다 (0) | 2023.05.08 |
Minikube를 사용하는 Windows Home 브라우저에서 Kubernetes Ingress에 액세스할 수 없습니까? (0) | 2023.05.08 |
Kubernetes 서비스 외부 IP 보류 중 (0) | 2023.05.07 |