DMAudioStreamer
DMAudioStreamer copied to clipboard
Notification causes crash after 8.1 updates
I have been getting this crash when trying to display notification:
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=0 contentView=com.humancondition.wtm/0x7f0d0044 vibrate=null sound=null defaults=0x0 flags=0x42 color=0x00000000 vis=PRIVATE) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
The solution to it is given on this SO post. Can you please update your Notification builder as to solve this crash?
All the best.
Thanks :) MilanVucic, sure will update notification builder
Amazing, thank you man. Can you ping this thread and close it once it has been implemented?
Cheers, thanks.
@dibakarece When can we expect to have this up? I am using this in an app and I'd really appreciate this feature. Thank you.
@MilanVucic could you checkout now and see if this is solved?
Latest version has been released now. Please test with latest version and let me know if any issue. -> implementation 'com.github.dibakarece:DMAudioStreamer:v1.0.5'
Well when I change to v1.0.5 it doesn't build properly.
I get 3 errors error: failed linking references.
. When I open one of the files where the error occurs, I see this like <item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
in values-v28.
And the error is error: resource android:attr/dialogCornerRadius not found.
I had to use v1.0.4 in order to have the project build. I reverted back and it builds just fine. So something went wrong @archie94 @dibakarece
Can you please send me your app build.gradle detail... I just migrate my project to androidx ..probably that is the reason.
I cant see android:attr/dialogCornerRadius
property in this project? Could you please send the entire stack trace?
@dibakarece @archie94 I managed to fix it using this question. I actually just changed the compileSdkVersion
to 28
. It was 27. It now builds.
BUT there's a new problem:
Program type already present: android.support.v4.media.MediaBrowserCompat$CustomActionCallback Message{kind=ERROR, text=Program type already present: android.support.v4.media.MediaBrowserCompat$CustomActionCallback, sources=[Unknown source file], tool name=Optional.of(D8)}
I googled it, and found this. Apparently it has to do with androidX library. The answer didn't help me though.
I've had "program type already" present errors before. That's the case when 2 dependencies rely on the same thing and try to include it twice, as far as I understood. Can you check what's going on with this?
It is very weird though, it DOES build once I click on "Build" only. But when I try to run, I get this.
android.support.v4.media.MediaBrowserCompat
is in package androidx.media:media:1.0.0
and also in some android.support.v4 which is present in your project I am assuming.
Try using
configurations.all {
resolutionStrategy {
force 'androidx.media:media:1.0.0'
}
}
and see if this solves your problem.
Nope, still doesn't work. Can we do without AndroidX cause it seems to mess it up? @archie94 Still same error. Program type already present.
AndroidX is the unavoidable future.
I would suggest you try to migrate your project to AndroidX. https://developer.android.com/jetpack/androidx/migrate
It is true that this AndroidX dependency adds a headache for consumers of this library and if it is too much of inconvenience we may have to do without it for now. Let's see what @dibakarece thinks about this.
let me check with andorid 28.0 build gradle lib ... if it's okay difinitly will provide some solution for you :)
Thanks man, I appreciate it very much. Let me know when you think of a solution.
Notification not showing on Android Pie, what is the solution even when i fork the sample project from the library...notification still not showing on android pie