Is anyone getting frequent ANRs on Android 14 when...
# compose
a
Is anyone getting frequent ANRs on Android 14 when using compose suddenly? It does not seem like Android 13 has this issue
a
All ANRs we experience (as reported by Crashlytics) are also on older Android releases, so not sure. Here's the 30-day trend for us:
There's definitely more ANRs after switching to Compose though
a
Interesting. We have quite a lot more ANRs in recent weeks it feels like, we have been using compose for about 2 years now, so its not just switching to compose It seems like its more clustered around Android 13 and especially 14 and pixel devices, but then again, this might just be because pixels have android 14, so not sure it definitely also happens on older versions tracing shows that the Recomposer is just stopping (Recomposer.cancel()) being called for no apparent reason, then restarting after about 10-15 seconds and the app works as regular (with an ANR inbetween of course). Nothing much happening on the main thread and even minimal samples show this behavior at random times it seems. Less pronounced on emulators that have more power than mobile devices (?). wondering if anyone is experiencing similar things.
e
Do you use AndroidView? I noticed a lot of performance issues on screens using AndroidView, especially when fragments are involved, after posting to Android 14.
a
we do use AndroidView, and also fragments (legacy code), what kind of issues are you seeing? ANRs?
e
Very poor performance and occasional ANRs. It only happens in debug builds though. I filed a bug but ultimately we removed as much of the AndroidViews as we were able to
a
Hi @eygraber is there any root cause? what are doing in case some view are not available in compose like video view?
e
My investigation didn't find anything actionable other than migrating those screens to compose. I don't have a good answer for what to do if there isn't a compose equivalent, sorry.
👍 1
c
Seems like I’m facing the same issue - I guess nobody found a better solution than migrating away from
AndroidView
? Unfortunately that’s not an option for me in one case
a
@Christian Würthenr For us the issue magically resolved itself for the most part. It seems like Google was shipping something under the hood (no visible software update and no change to our code) and it magically started working on our testing devices. Pretty spooky actually.
c
Hm, I don't see it go down yet, actually it was trending up a bit over time, I assume as Android 14 got more popular. Problem is I can't recreate the issue which makes solving it almost impossible 😄 Will make sure to update everything to latest and replace
AndroidView
where possible, hopefully that solves it Thanks for getting back to me!
👍 1
a
Sorry that I cannot give you anything better than “it just started working” 😄
I remember us not being able to reproduce it too, just sometimes
c
Do you know if it was a temporary ANR for you or a "terminal" one? I have one user reporting the app just completely freezes but the reports I have in Firebase indicate it's a temporary issue that resolves itself pretty quickly
I can confirm that removing
AndroidView
solved this issue for me as well. I think the problematic
AndroidView
hat too many updates (~30/second, by design) and that blew something up on Android 14 for some reason