flutter 致命异常:无法扩展内容视图java.lang,设置在紧凑视图中显示操作:操作0超出界限(最大值-1)

2w3rbyxf  于 2022-12-30  发布在  Flutter
关注(0)|答案(1)|浏览(81)

我使用测试实验室来查找我的应用程序上的bug,我有一个但是我找不到源头。我认为它来自just_audio或audio_service。
这是测试问题:

android.app.RemoteServiceException: Bad notification(tag=null, id=1124) posted from package com.our_unseen_nature, crashing app(uid=10274, pid=22490): Couldn't inflate contentViewsjava.lang.IllegalArgumentException: setShowActionsInCompactView: action 0 out of bounds (max -1)
     FATAL EXCEPTION: main
Process: com.our_unseen_nature, PID: 22490
android.app.RemoteServiceException: Bad notification(tag=null, id=1124) posted from package com.our_unseen_nature, crashing app(uid=10274, pid=22490): Couldn't inflate contentViewsjava.lang.IllegalArgumentException: setShowActionsInCompactView: action 0 out of bounds (max -1)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2005)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7664)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

谢谢大家。

2izufjch

2izufjch1#

谢谢大家,我已经找到了解决方案,这真的很容易.发生错误是因为我没有正确选择的动作显示在Android的紧凑视图的基础上,我已经选择作为我的控件.

controls: [
     MediaControl. skipToPrevious,
     MediaControl.pause,
     MediaControl.skipToNext,
   ],
 
   // Which controls to show in Android's compact view
   //from the lists of controls selected.
   androidCompactActionIndices: const[0, 1, 2],

相关问题