AudioKit / AudioKit

Audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

Home Page:http://audiokit.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to import AudioKit on a Capacitor iOS plugin

vycoder opened this issue · comments

commented

macOS Version(s) Used to Build

macOS 12 Monterey

Xcode Version(s)

Xcode 13.4

Description

I'm fairly new to Swift develoment but I think I've exhausted every resource I can get. I've been trying for a week now and I'm hoping someone could point me in the right direction.

I'm working on a Capacitor iOS plugin that uses AudioKit. Following the installation instructions on the README file, it builds properly on it's own. The problem is when I use the plugin that that uses AudioKit on my Capacitor project. It can't seem to find AudioKit on build and says, Module AudioKit not found.

I've read somewhere that I should drag-and-drop the .framework directory on to my project but that seems like an outdated way of doing it. I've also tried doing a swift build -c release hoping to get it compiled along with the plugin to no avail, or there might be something else I'm missing.

The capacitor plugin is eventually built as a pod, and the pod is what gets included on the actual Capacitor project, I think that's mainly where the issue lies.

I've tried looking at the docs, but I can't seem to find anything related to it. I've found a few outdated articles on how to compile but that doesn't seem to work any longer.

Should I suppose to compile it first for it to work with my Capacitor plugin pod? Can someone point in the right direction?

Crash Logs, Screenshots or Other Attachments (if applicable)

No response

I don't know what Capacitor is, some javascript thing? I don't know what AudioKit should do differently in order to be used that way. Maybe it shouldn't fall on our shoulders to support any of the various ways to build apps outside of the traditional Xcode/Swift approach. Let me know if I am missing something.

commented

Yes, Capacitor is something that bridges Swift/iOS to javascript. But what it needs is really just a Cocoapod.

That's where I'm at, outside of any integration to javascript. Just the context of a reusable Cocoapod. Basically what I'm just trying to do is something like:

AudioKit -> MyCocoaPod -> MySwiftApp

I'm wrapping AudioKit into a Cocoapod that I'm eventually using on MySwiftApp.

I can properly make it compile on MyCocoaPod (I think), but over at MySwiftApp it fails. (Import to AudioKit error, inside of the MyCooaPod)

I'm not sure what I'm doing wrong here. Is it not possible to wrap AudioKit in a cocoapod? are there any other approach?

Would appreciate any help on this case.

We abandoned Cocoapod support for Swift Package Manager years ago.

commented

I believe I've read that somewhere. So now I'm just wondering if there's like other approach?

Like somehow build AudioKit from source and then import it on my cocoapod so it gets "packaged" with it. This is where I can't find any info.

My last approach was to go in AudioKit, copy the things that I need, (to play frequencies) and then paste it on my cocoapod.

In this case, was that really my only option?