Audiokit crashes when enabling sandbox in OS X

倾然丶 夕夏残阳落幕 提交于 2019-12-24 10:08:07

问题


My app using Audiokit is running perfectly without sandbox. But as soon as I enable sandbox in Xcode the app crashes when trying to initialize the mic access. (The app is on the App Store for iOS, but now I am trying to submit to the Mac Store as a OS X app but I need to enable sandbox)

Has anyone been able to submit a Mac app to the Mac App Store with Audiokit in it?

ERROR: >avae> AVAudioEngine.mm:275: AttachNode: required condition is false: node != nil


回答1:


To enable microphone access in App Store sandbox you'll need to add following entitlement:

com.apple.security.device.audio-input

See reference of Sandbox: Enabling Hardware Access




回答2:


This entitlements file did work for me. But it doesn't cover all the cases. Please check Apple documentation for more details https://developer.apple.com/library/archive/technotes/tn2312/_index.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>com.apple.security.app-sandbox</key>
  <true/>
  <key>com.apple.security.device.audio-input</key>
  <true/>
  <key>com.apple.security.device.audio-video-bridging</key>
  <true/>
  <key>com.apple.security.files.bookmarks.document-scope</key>
  <true/>
  <key>com.apple.security.network.client</key>
  <true/>
  <key>com.apple.security.temporary-exception.audio-unit-host</key>
  <true/>
  <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
  <array>
    <string>com.apple.midiserver</string>
    <string>com.apple.midiserver.io</string>
  </array>
</dict>



来源:https://stackoverflow.com/questions/49115091/audiokit-crashes-when-enabling-sandbox-in-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!