android / android/codelab-activity_transitionapi

Application terminated or no activity reported on Android 13

Offen
#29 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
24
Forks
9
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I did no changes in the code, compiled, ran on Samsung with Android 13, application was terminated with following error, adding FLAG_IMMUTABLE to PendingIntent.getBroadcast(MainActivity.this, 0, intent, **0**) eliminates the exception, but no activity is reported

FATAL EXCEPTION: main
Process: com.google.example.android.basicactivityrecognitiontransitionsample, PID: 21094
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.example.android.basicactivityrecognitiontransitionsample/com.google.example.android.basicactivityrecognitiontransitionsample.MainActivity}: java.lang.IllegalArgumentException: com.google.example.android.basicactivityrecognitiontransitionsample: 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie in MainActivity beim im Bericht gezeigten Aufruf von PendingIntent.getBroadcast und prüfen Sie, wie sich dessen Flags auf Android 13 auswirken. Reproduzieren Sie den Absturz auf Android 13 und überprüfen Sie anschließend, dass die Anwendung startet und Aktivitätsübergänge nach der Änderung gemeldet werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, java
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.