Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification causes crash after 8.1 updates #20

Open
MilanVucic opened this issue Aug 23, 2018 · 16 comments
Open

Notification causes crash after 8.1 updates #20

MilanVucic opened this issue Aug 23, 2018 · 16 comments

Comments

@MilanVucic
Copy link

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.

@dibakarece
Copy link
Owner

Thanks :) MilanVucic,
sure will update notification builder

@MilanVucic
Copy link
Author

Amazing, thank you man. Can you ping this thread and close it once it has been implemented?

Cheers, thanks.

@MilanVucic
Copy link
Author

@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.

@archie94 archie94 mentioned this issue Dec 25, 2018
@archie94
Copy link
Contributor

@MilanVucic could you checkout now and see if this is solved?

@dibakarece
Copy link
Owner

dibakarece commented Dec 26, 2018

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'

@MilanVucic
Copy link
Author

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

@dibakarece
Copy link
Owner

dibakarece commented Jan 15, 2019 via email

@archie94
Copy link
Contributor

I cant see android:attr/dialogCornerRadius property in this project? Could you please send the entire stack trace?

@MilanVucic
Copy link
Author

@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.

@MilanVucic
Copy link
Author

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.

@archie94
Copy link
Contributor

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.

@MilanVucic
Copy link
Author

MilanVucic commented Jan 17, 2019

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.

@archie94
Copy link
Contributor

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.

@dibakarece
Copy link
Owner

dibakarece commented Jan 22, 2019 via email

@MilanVucic
Copy link
Author

Thanks man, I appreciate it very much. Let me know when you think of a solution.

@enyholar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants