我的应用程序在定位到 Android 12 时崩溃了
这是崩溃日志:
java.lang.RuntimeException: Unable to create service com.kdr.snipping.CheckRecentRun: java.lang.IllegalArgumentException: com.kdr.snipping: 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.ActivityThread.handleCreateService(ActivityThread.java:4500)
at android.app.ActivityThread.access$1700(ActivityThread.java:247)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2072)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at …Run Code Online (Sandbox Code Playgroud)javascript android android-pendingintent android-studio android-12