react-native - 捕获错误 - setShowActionsInCompactView
问题描述
我尝试为我的项目使用https://github.com/tanguyantoine/react-native-music-control包,但每次遇到错误时:
setShowActionsInCompactView: action 0 out of bounds (max -1)
我的代码来自演示应用程序:
MusicControl.enableBackgroundMode(true);
MusicControl.setNowPlaying({
title: 'Billie Jean',
artwork: 'https://i.imgur.com/e1cpwdo.png',
artist: 'Michael Jackson',
album: 'Thriller',
genre: 'Post-disco, Rhythm and Blues, Funk, Dance-pop',
duration: this.whoosh.getDuration(),
description: 'Billie Jean is a song by American singer Michael Jackson. It is the second single from the singer\'s sixth solo album, Thriller (1982). It was written and composed by Jackson and produced by Jackson and Quincy Jones.',
date: '1983-01-02T00:00:00Z',
rating: 84
})
MusicControl.enableControl('play', false)
MusicControl.enableControl('pause', true)
我已将代码简化为简单的调用:
MusicControl.setNowPlaying({
title: 'Billie Jean',
})
但错误仍在抛出。然后我尝试按原样运行演示项目https://github.com/tanguyantoine/react-native-music-control-demo并且我再次失败并出现同样的错误
我发现很多项目都使用这个包,而且我的代码很熟悉。任何人都可以给我一个提示我犯错的地方吗?
解决方案
损坏的当前软件包版本 - 0.9.8
讨论https://github.com/tanguyantoine/react-native-music-control/issues/230
推荐阅读
- python - 从 textinput 更改更新 kivy recycleview self.data
- python - Python Gtk Notebook 从按钮打开一个新选项卡
- react-native - 如何在本机反应中使用状态钩子来动态创建组件
- ios - 没有为给定的视图控制器注册本机启动画面。首先为给定的视图控制器调用“splashscreen.show”
- javascript - 仅使用解析和 Math.random 从 JSON 中获取随机值,没有循环、数组和 Object.keys
- grid - 如何将 QML 中的项目包装和堆叠成行和列
- python - 如何使用opencv获取轮廓作为图像
- python-3.x - 在 python 中导入包时遇到问题
- postgresql - 将记录从一个表插入到另一个表,然后删除插入的记录
- delphi - 如何在不重新安装整个 JVCL 库的情况下修复 JvYearGrid 控件的小错误