在iOS测试中未启用后台模式 [英] Background mode is not enabled in iOS tests

查看:88
本文介绍了在iOS测试中未启用后台模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Swift库,该库又将AudioKit库用作依赖项.在iOS中使用AudioKit时,您必须在项目设置的功能部分中启用背景模式".但是,在运行iOS测试时,没有进行此类配置的地方,因此您会遇到此错误:

I'm writing a Swift library which in turn uses the AudioKit library as a dependency. When using AudioKit in iOS, you'll have to enable 'Background Mode' in the capabilities section in project settings. But when running iOS tests, there's no place for such configuration and as a result you're confronted with this error:

CheckError错误:kMIDINotPermitted:您是否在ios应用中启用了音频背景模式>?

CheckError Error: kMIDINotPermitted: Have you enabled the audio background mode > in your ios app?

我尝试将相应的必需的后台模式"条目添加到库和测试文件的plist文件中,但无济于事.也许AudioKit的测试代码可以说明一些问题?谢谢.

I tried adding the corresponding "Required background modes" entry to the plist file for both the library and the test file to no avail. Perhaps the testing code for AudioKit can shed some light? Thanks.

推荐答案

我找到了解决方法:

在背景模式"下的项目的功能"标签中启用背景音频.

Enable background audio in the "Capabilities" tab for your project, under "Background Modes."

参考

这篇关于在iOS测试中未启用后台模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆