报错信息如下:
java.lang.SecurityException: Caller cn.wildfirechat.chat needs to hold android.permission.SCHEDULE_EXACT_ALARM or android.permission.USE_EXACT_ALARM to set exact alarms.
at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
at android.os.Parcel.createException(Parcel.java:3041)
at android.os.Parcel.readException(Parcel.java:3024)
at android.os.Parcel.readException(Parcel.java:2966)
at android.app.IAlarmManager$Stub$Proxy.set(IAlarmManager.java:311)
at android.app.AlarmManager.setImpl(AlarmManager.java:1084)
at android.app.AlarmManager.setImpl(AlarmManager.java:1044)
at android.app.AlarmManager.setExact(AlarmManager.java:808)
at com.tencent.mars.comm.Alarm.setAlarmMgr(Alarm.java:164)
at com.tencent.mars.comm.Alarm.start(Alarm.java:98)
at com.tencent.mars.comm.PlatformComm$C2Java.startAlarm(PlatformComm.java:193)
解决方案:
AndroidManifest.xml
里面,将targetSdkVersion
更新为33