Android App: Bad notification Exception
On the Android app I frequently encounter exceptions with the message "RemoteServiceException: Bad notification(tag=null, id=1) posted from package net.wigle.wigleandroid, crashing app: Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$DecoratedCustomViewStyle cannot be cast to android.app.Notification$MessagingStyle". They appear most frequently when the app has been in the background for a while, but even going from the settings to the networks view has triggered this for me.
I have given the app all permissions I can. An full example error below, they are all pretty much identical:
I have given the app all permissions I can. An full example error below, they are all pretty much identical:
Code: Select all
WigleWifi error log - 13 Oct 2024 19:27:24
versionName: 2.88
packageName: net.wigle.wigleandroid
MODEL: Mi 10
RELEASE: 11
BOARD: umi
BRAND: Xiaomi
DEVICE: umi
DISPLAY: RKQ1.200826.002 test-keys
FINGERPRINT: Xiaomi/umi_eea/umi:11/RKQ1.200826.002/V12.2.7.0.RJBEUXM:user/release-keys
HOST: c4-xm-ota-bd091.bj
ID: RKQ1.200826.002
PRODUCT: umi_eea
TAGS: release-keys
TIME: 1614605183000
TYPE: user
USER: builder
baseError: RemoteServiceException: Bad notification(tag=null, id=1) posted from package net.wigle.wigleandroid, crashing app(uid=10598, pid=19152): Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$DecoratedCustomViewStyle cannot be cast to android.app.Notification$MessagingStyle
android.app.RemoteServiceException: Bad notification(tag=null, id=1) posted from package net.wigle.wigleandroid, crashing app(uid=10598, pid=19152): Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$DecoratedCustomViewStyle cannot be cast to android.app.Notification$MessagingStyle
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Thread: Thread[main,5,main] throwable: android.app.RemoteServiceException: Bad notification(tag=null, id=1) posted from package net.wigle.wigleandroid, crashing app(uid=10598, pid=19152): Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$DecoratedCustomViewStyle cannot be cast to android.app.Notification$MessagingStyle
19:24:45.319 OkHttp https://api.wigle.net/...] [CERTTRANS] Success: SCT trusted logs [E0rfGrWYQgl4DG/vTHqRpBa3I0nOWFdq367ap8Kr4CI=:Valid SCT, fVkeEuF4KnscYWd8Xv340IdcFKBOlZ65Ay/ZDowuebg=:Valid SCT]
19:25:05.718 GuardThread-Thread-3] Service is foreground: true
19:25:52.685 GuardThread-Thread-3] Service is foreground: true
19:25:57.008 OkHttp https://api.wigle.net/...] [CERTTRANS] Success: SCT trusted logs [E0rfGrWYQgl4DG/vTHqRpBa3I0nOWFdq367ap8Kr4CI=:Valid SCT, fVkeEuF4KnscYWd8Xv340IdcFKBOlZ65Ay/ZDowuebg=:Valid SCT]
19:25:57.490 OkHttp https://api.wigle.net/...] [CERTTRANS] Success: SCT trusted logs [E0rfGrWYQgl4DG/vTHqRpBa3I0nOWFdq367ap8Kr4CI=:Valid SCT, fVkeEuF4KnscYWd8Xv340IdcFKBOlZ65Ay/ZDowuebg=:Valid SCT]
19:26:53.956 GuardThread-Thread-3] Service is foreground: true
19:26:55.783 main] MAIN: restart.
19:26:55.785 main] MAIN: start.
19:26:55.785 main] UPLOADS: onStart
19:26:55.786 main] MAIN: resume.
19:26:55.786 main] GoogleApiAvailability: 0
19:26:55.786 main] MAIN: post resume.
19:26:55.786 main] UPLOADS: onResume
19:26:58.400 OkHttp https://api.wigle.net/...] [CERTTRANS] Success: SCT trusted logs [E0rfGrWYQgl4DG/vTHqRpBa3I0nOWFdq367ap8Kr4CI=:Valid SCT, fVkeEuF4KnscYWd8Xv340IdcFKBOlZ65Ay/ZDowuebg=:Valid SCT]
19:27:08.978 GuardThread-Thread-3] Service is foreground: true
19:27:13.257 OkHttp https://api.wigle.net/...] [CERTTRANS] Success: SCT trusted logs [E0rfGrWYQgl4DG/vTHqRpBa3I0nOWFdq367ap8Kr4CI=:Valid SCT, fVkeEuF4KnscYWd8Xv340IdcFKBOlZ65Ay/ZDowuebg=:Valid SCT]
19:27:21.528 main] MAIN: pause.
19:27:21.528 main] UPLOADS: onPause
19:27:22.453 main] MAIN: stop.
19:27:22.454 main] UPLOADS: onStop
19:27:22.455 main] MAIN: onSaveInstanceState
19:27:23.991 GuardThread-Thread-3] Service is foreground: true
19:27:24.343 main] Thread: Thread[main,5,main] throwable: android.app.RemoteServiceException: Bad notification(tag=null, id=1) posted from package net.wigle.wigleandroid, crashing app(uid=10598, pid=19152): Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$DecoratedCustomViewStyle cannot be cast to android.app.Notification$MessagingStyle
19:27:24.347 main] Thread: Thread[main,5,main] throwable: android.app.RemoteServiceException: Bad notification(tag=null, id=1) posted from package net.wigle.wigleandroid, crashing app(uid=10598, pid=19152): Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$DecoratedCustomViewStyle cannot be cast to android.app.Notification$MessagingStyle
19:27:24.348 main] Writing stackfile to: /data/user/0/net.wigle.wigleandroid/files/errorstack_1728840444348.txt
We see these in our Google console- the problem is likely that Xiaomi/Redmi/Hauwei phones make changes to core Android that break things in ways we can't debug or fix reliably from update to update. The OS is preemptively disposing of our notification channels while the WiGLE foreground service is still running, which shouldn't happen (vendors do this to "optimize" battery life).
1. are you in developer mode? If so, have you changed any settings (there are settings you can modify to ostensibly speed performance that will break this specific thing)
2. if you turn off "toast notifications" in the app settings - does the problem (mostly?) go away?
1. are you in developer mode? If so, have you changed any settings (there are settings you can modify to ostensibly speed performance that will break this specific thing)
2. if you turn off "toast notifications" in the app settings - does the problem (mostly?) go away?
Turning off toast notifications makes the problem a lot less frequent. Now it mostly happens when the app has been in the background for a couple minutes.
I'm in developer mode. The only setting I changed is turning off Wi-Fi scan throttling.
Knowing that this is somehow related to Xiaomi/Redmi/Huawei is useful info. There are some developer settings that might have an impact (like turning off MIUI optimization). I'll test some settings and report back
I'm in developer mode. The only setting I changed is turning off Wi-Fi scan throttling.
Knowing that this is somehow related to Xiaomi/Redmi/Huawei is useful info. There are some developer settings that might have an impact (like turning off MIUI optimization). I'll test some settings and report back
awesome - appreciate you digging in - we don't have a lot of test devices in that family, so we welcome info, and I suspect so does the community at large!
Right now I have the following changes active, and the app is a lot more usable:
I'll continue testing if there's any rhyme or reason to this
- Wigle -> disable toasts
- Settings -> Apps -> Wigle -> Battery Saver -> No restrictions (as well as all permissions etc)
- Developer Settings -> MIUI optimisation off
- Developer Settings -> Background process limit -> At most 4 (the highest available)
I'll continue testing if there's any rhyme or reason to this
After some more testing I can say that turning off MIUI optimization has a big effect, so certainly don't skip this step.
However it's a double-edged sword: not only does turning it on or off reset some permissions, if you turn off MIUI optimizations the database exports don't work. The wigle app seems to generate the files but other apps can't find them. With MIUI optimizations on the file export works flawlessly
However it's a double-edged sword: not only does turning it on or off reset some permissions, if you turn off MIUI optimizations the database exports don't work. The wigle app seems to generate the files but other apps can't find them. With MIUI optimizations on the file export works flawlessly
Does the "share" dialog simply fail to pop up, or when you select where to send your file does it fail?
Fundamentally, Android has moved to a model where each app's filespace is encrypted, so it's not like the old days where could just poke around the SD card and find the files.
Fundamentally, Android has moved to a model where each app's filespace is encrypted, so it's not like the old days where could just poke around the SD card and find the files.
Who is online
Users browsing this forum: Google [Bot] and 2 guests