如何在新项目 xcode 11 和 swift 5.1 中包含 Audiokit 4? [英] How to include Audiokit 4 in a new project xcode 11 and swift 5.1?

查看:45
本文介绍了如何在新项目 xcode 11 和 swift 5.1 中包含 Audiokit 4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近尝试使用 Xcode 11 和 swift 5.1 在一个新项目中包含 Audiokit 4,但我收到错误消息 No such module Audiokit,这是我最接近 AudiokitCoreAudiokit 按照 (

我已经仔细检查了发行说明,它清楚地说明了对 Xcode 11 的支持(

可以看到frameworks下的AudioKit框架:

其他链接器标志也按照说明设置:

更新到 Xcode 11.4(最新),同样的问题.

还测试了移动 audiokit 目录,同样的问题,似乎没有任何效果,所以不确定其他人在考虑 github 中的评论时在做什么,他们似乎将它与 Xcode 11.4 一起使用...

解决方案

经过几个小时的尝试,我找到了解决方案!在继续之前请记住,我已更新到最新(撰写本文时)Xcode 11.4 和 swift 5.2.

我已将文件从 Frameworks/AudioKit.framework 移至项目:

然后,在显示/隐藏检查器中选择 AudioKit.framework 时,我将位置更改为 relative to project 并定位到当前项目名称,如下所示(项目名称更改为 test 与早期或原始发布版本相比):

Obs:我还通过修改构建设置进行了测试,删除了所有子目录以在递归搜索扩展中排除;并将可以找到 audiokit.framework 的相对路径添加到框架搜索路径中.自动完成工作,但我仍然收到错误 No such module 'AudioKit'.所以,到目前为止,唯一有效的选项是之前的评论.

--------------------- 几天后----------------

只是快速浏览了一下,并决定在此处更新报告.

不幸的是,上述修复删除了未找到"错误,但应用程序崩溃.使用 cocoapods 安装 audiokit 似乎也不会导致找不到模块错误".

-------------------- 几周后--------------------

使用 cocoapods 将音频包含到您的项目中,如上次所述,如下所示:

平台:ios,'11.0'目标AKRecorder"做使用_框架!pod 'AudioKit', '~>4.9.5'结尾

I've recently tried to include Audiokit 4 in a new project using Xcode 11 and swift 5.1, but I get the error message No such module Audiokit, the closest I get to Audiokit is CoreAudiokit by following the instructions in (https://github.com/audiokit/AudioKit/blob/master/Frameworks/README.md).

Here're the steps I followed:

1) Create new single view project in xcode11

2) Project settings, General tab, Frameworks/Libraries added item Audiokit.framework

3) In the ContentView.swift file: import Audiokit or import AudioKit

I've doubled checked the release notes and it clearly states support for Xcode 11 (https://github.com/audiokit/AudioKit/releases)

Finally, tried to compile it myself but the same issue as stated above, module not found.

git clone https://github.com/audiokit/AudioKit.git

./build_frameworks.sh

I can see the AudioKit framework under frameworks:

Other linker flags is also set as instructed:

Updated to Xcode 11.4 (latest), same issue.

Also tested moving the audiokit dir, same issue, nothing seems to make it work, so not sure what other people been doing considering the comments in github which seems they use it with Xcode 11.4...

解决方案

After hours trying things, I found a solution! Just have in mind before proceeding that I've updated to the latest (time of writing) Xcode 11.4 and swift 5.2.

I've moved the file from Frameworks / AudioKit.framework to the project:

And then, while selecting the AudioKit.framework in the show/hide inspector, I change the location to relative to project and target to the current project name as follows (the name of the project changed to test in comparison with the earlier or original post version):

Obs: I've also tested by modifying the build settings, removed all subdirectories to exclude in recursive searches extensions; and add the relative path where the audiokit.framework can be found to the framework search paths. The autocomplete works, but I still get the error No such module 'AudioKit'. So, this far the only option that works is the comment before.

--------------------- a few days later ------------------------

Just had a quick look at this and decided to update the report here.

Unfortunately, the fix above removes the "not found" error but the application crashes. Using cocoapods to install audiokit also seems to not cause the "module not found error".

-------------------- weeks later --------------------

Use cocoapods to include audio into your project as last stated and as follow:

platform :ios, '11.0'

target 'AKRecorder' do
  use_frameworks!

  pod 'AudioKit', '~> 4.9.5'

end

这篇关于如何在新项目 xcode 11 和 swift 5.1 中包含 Audiokit 4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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