Audio_service: Android MediaControl button doesn't appear in the notification mediaplayer

Created on 16 Jul 2020  ยท  7Comments  ยท  Source: ryanheise/audio_service


Which API doesn't behave as documented, and how does it misbehave?
In the notification mediaplayer on android the media control buttons aren't drawn, but still can be pressed. This only happens on a release build made with "flutter build apk".

Minimal reproduction project
Unfortunately I don't know what causes this. Cloned example project from github works. I have the appropriate assets defined in the res folder too.

To Reproduce (i.e. user steps, not code)
I don't know.

Error messages
No error messages

Expected behavior
A notification media player with clearly visible buttons.

Screenshots
If applicable, add screenshots to help explain your problem.

Runtime Environment (please complete the following information if relevant):

  • Device: Huawei P Smart Z
  • OS: Android 10.0.0

Flutter SDK version
Flutter 1.18.0-13.0.pre

``` Doctor summary (to see all details, run flutter doctor -v):
[โœ“] Flutter (Channel unknown, 1.18.0-13.0.pre, on Mac OS X 10.14.6 18G103, locale en-SI)

[โœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[โœ“] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[โœ“] Android Studio (version 3.5)
[โœ“] VS Code (version 1.47.1)
[โœ“] Connected device (1 available)

โ€ข No issues found! ```

1 backlog bug

All 7 comments

fixed it. In case someone else is having this problem, this is what helped me: https://stackoverflow.com/questions/61005254/android-drawables-work-in-debug-but-become-black-squares-in-release

This is interesting. Didn't the instructions on shrinking that I provided in the README work? Let me know if not and I'll need to update them.

what happened was that i forgot what that line in app/build.gradle did, and i threw it out when i was modifying the file for production build. My bad. Thank you for your response though :)

@eAvio Hey can you help me with this im all so having same problem

See This Here https://github.com/ryanheise/audio_service/issues/503

@girish54321 For me the problem was that I accidentally removed "shrinkResources false" line app/build.gradle when i was preparing my app for production. Check if you have it.

android {
    compileSdkVersion 28
    ...
    buildTypes {
        release {
            signingConfig ...
            shrinkResources false // ADD THIS LINE
        }
    }
}

Check out the 2. step in the "Android setup" section of the README of this package. Hope this works for you.

@eAvio thanks i will check this

@eAvio hey it works thank you so much ๐Ÿ‘๐Ÿ‘

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lain-ke picture lain-ke  ยท  6Comments

Divyanshu133 picture Divyanshu133  ยท  5Comments

ryanheise picture ryanheise  ยท  6Comments

MohamedAbdallah-14 picture MohamedAbdallah-14  ยท  7Comments

Drabuna picture Drabuna  ยท  7Comments