Android 14로 sdk를 상향하고 대응을 하던 중...
위젯에서 또또또또또 문제가 생김을 확인했다.
Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
해당 내용은 읽어보면 단순히 이제 34 레벨에서부터 PendingItent 전달할거면 Flag 를 뫄뫄로 변경해라 ~ 이런 내용인데...
14 변경사항 중 관련있는 내용은 위와 같다.
fun getPendingIntent(context: Context, action: String ): PendingIntent {
val intent = Intent(action).apply {
`package` = context.packageName
component = ComponentName(context, RECEIVER)
}
return PendingIntent.getBroadcast(
context,
0,
intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
}
패키지 명도 넣어줬지.. 플래그도 다 뺐지.. 뭘 잘못했는가 내가
몇시간동안 sdk 문제인줄 알고 이것저것 찾아보고 디버깅도 돌려봤는데 특이점을 찾았다.
그래서 뭔가.. 분명 Glance 문제이다 싶어서 IssueTracker로 들어갔다.
검색했더니 바아아아아로 나왔다.
나랑 아주 똑같은 로그를 가지고 있는 사람!
라이브러리 버전업을 했더니 해결완료
위의 이슈는 1.0.0-rc01 버전에서 해결되었다고 합니다.