Audio_service: Exception for androidCompactActions

Created on 6 Oct 2020  Â·  6Comments  Â·  Source: ryanheise/audio_service


The error appears in the compiled (release) version.
There are phone versions where all 4 control buttons do not fit in notifications.

Thanks to your androidCompactActions property - it helped me a lot, there are fewer buttons and they are all visible on the notification !!!)))

But another problem appeared on other devices ...
Errors are given below. I hope very much for your help!)

Errors log on device android 7.0 arm x86_64

android.app.RemoteServiceException: Bad notification posted from package radio.radiogram: Couldn't inflate contentViewsjava.lang.IllegalArgumentException: setShowActionsInCompactView: action 2 out of bounds (max 1)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1716)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:165)
 at android.app.ActivityThread.main(ActivityThread.java:6375)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)

Errors log on device Redmi Note 8 Pro (mobile) • gubexwivz5e6eyt8 • android-arm64 • Android 10 (API 29)

android.app.RemoteServiceException: Bad notification(tag=null, id=1124) posted from package radio.radiogram, crashing app(uid=10631, pid=17495): Couldn't inflate contentViewsjava.lang.IllegalArgumentException: setShowActionsInCompactView: action 2 out of bounds (max 1)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1997)
 at android.os.Handler.dispatchMessage(Handler.java:107)
 at android.os.Looper.loop(Looper.java:224)
 at android.app.ActivityThread.main(ActivityThread.java:7551)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)

The part of the code where I send the task to the notification

  AudioServiceBackground.setState(
    controls: gIsFavourit
        ? [
            MediaControl.skipToPrevious,
            _audioPlayerCurrent.playing
                ? MediaControl.pause
                : MediaControl.play,
            MediaControl.stop,
            MediaControl.skipToNext,
          ]
        : [
            _audioPlayerCurrent.playing
                ? MediaControl.pause
                : MediaControl.play,
            MediaControl.stop,
          ],
    systemActions: [
      MediaAction.skipToPrevious,
      MediaAction.play,
      MediaAction.pause,
      MediaAction.stop,
      MediaAction.skipToNext,
    ],
    processingState: _getProcessingState(),
    playing: _audioPlayerCurrent.playing,
    androidCompactActions: [0, 1, 3],
  );

Flutter SDK version

[√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18363.1082], locale ru-RU)
    • Flutter version 1.20.4 at C:\fluttersdk\flutter
    • Framework revision fba99f6cf9 (3 weeks ago), 2020-09-14 15:32:52 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\OKJI\AppData\Local\Android\sdk
    • Platform android-30, build-tools 29.0.2
    • ANDROID_HOME = C:\Users\OKJI\AppData\Local\Android\sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 50.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.49.3)
    • VS Code at C:\Users\OKJI\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.15.0

[√] Connected device (2 available)
    • Redmi Note 8 Pro (mobile)             • gubexwivz5e6eyt8 • android-arm64 • Android 10 (API 29)
    • Android SDK built for x86 64 (mobile) • emulator-5554    • android-x64   • Android 7.0 (API 24) (emulator)

• No issues found!
exit code 0

1 backlog bug

All 6 comments

This issue was automatically closed because it did not follow the issue template.

what about this bot? why was this problem closed?

Hi @Okladnoj .

This issue was automatically closed because it did not follow the issue template.

How can I improve on the wording of this message so that someone doesn't ask "why was this problem closed?"

I'm asking genuinely, if you can suggest how to make the message clearer, I will update the bot's message.

personally, I don't understand...
Or I have an incorrect message and need to be rewritten.

Or such a problem has already been and this issue is not relevant.

Or you're just not interested in my problem.

Please give the bot specifics:

  • if I incorrectly filled in the template let the bot say:
    "Edit your message according to the template provided, because it will be difficult for the author of the plugin to solve your problem"
  • if such a question was already a year old - the bot says:
    "This issue has already been raised in the forum, please look for it, there you may find a solution"
  • If you simply are not going to solve this problem, nothing needs to be done with the bot.
    (unless the bot says this: "The owner from the height of his flight does not dodge to descend to worldly fuss - solve your problems yourself" - a little humor)
    ;););););) ))))

Please give the bot specifics

Out of the 3 scenarios you described, it is only technically feasible to create a bot for the first one.

Thank you for your suggestion below:

Edit your message according to the template provided, because it will be difficult for the author of the plugin to solve your problem

I will think about updating the message to this, except that rather than edit your issue, you would need to create a new issue since that forces the submitter to go through the process again and see which parts of the template they may have deleted or ignored. What do you think about this version?

This issue was automatically closed because it did not follow the issue template. Please read the issue template carefully. (See FAQ number 1)

In the meantime, please create a new issue and follow all of the instructions carefully.

When you click on the "New issue" button and you see the selection of different issue templates, notice that it says under each title:

Follow the instructions carefully on the next page.

And then on the next page, the very first line says:

ALL SECTIONS BELOW MUST BE COMPLETED

And then in FAQ number 1, it says:

Follow the instructions carefully and supply all requested information, leaving the section headings intact, but filling in the body of each section. Please do not delete or skip these sections as they are necessary in order to investigate a bug.

Thanks a lot for the clarification. I didn't think I had to follow the pattern and change nothing there. As the time comes, we will create a "new release"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MahdiPishguy picture MahdiPishguy  Â·  5Comments

Divyanshu133 picture Divyanshu133  Â·  5Comments

lain-ke picture lain-ke  Â·  6Comments

mohammadne picture mohammadne  Â·  7Comments

Drabuna picture Drabuna  Â·  7Comments