android / android/codelab-activity_transitionapi
Application terminated or no activity reported on Android 13
- Dominant language
- Java
- Stars
- 24
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Research direction
Start in MainActivity at the PendingIntent.getBroadcast call shown in the report and review how its flags affect Android 13. Reproduce the crash on Android 13, then verify that the application starts and activity transitions are reported after the change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100