# Juce wrapper for SwiftUI project

**URL:** <https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931>\
**Category:** MacOSX and iOS\
**Created:** [July 14, 2021, 2:38am UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931 "2021-07-14T02:38:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbhydric](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jbhydric/32/11425_2.png) [@jbhydric](https://forum.juce.com/u/jbhydric)\
**Post date:** [July 14, 2021, 2:38am UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/1 "2021-07-14T02:38:35Z")

</div>

I’m attempting to create a SwiftUI project which can access an embedded Juce static library. I have no experience using Juce but am quite familiar with SwiftUI and iOS development. I’ve exported the library successfully using Projucer but haven’t been able to get the ObjC bridging layer working.

Are there any guides available on how to achieve this or am I attempting to solve this problem from the wrong angle. I have found an old example which mixes native UI elements with Juce components [GitHub - adamski/juce-native-navigation: JUCE iOS and Android project to show integration of native API's and JUCE components](https://github.com/adamski/juce-native-navigation) but have not been able to find anything specific to SwiftUI.

Thanks

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [July 17, 2021, 5:47pm UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/2 "2021-07-17T17:47:58Z")

</div>

@jbhydric I have fairly extensive experience with this kind of setup. If you check [this repo](https://github.com/adamski/audioengine-demo) there is an example of using a JUCE library project in an iOS Xcode project

---

<div class="post-metadata">

**Author:** ![jbhydric](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jbhydric/32/11425_2.png) [@jbhydric](https://forum.juce.com/u/jbhydric)\
**Post date:** [July 20, 2021, 1:27am UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/3 "2021-07-20T01:27:31Z")

</div>

@adamwilson the embedded juce library appears to compile ok, but the client app is returning this error on compilation:

> Undefined symbols for architecture arm64:  
> “_OBJC\_CLASS_$\_DemoAudioEngineBindings”, referenced from:  
> objc-class-ref in ViewController.o  
> ld: symbol(s) not found for architecture arm64  
> clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any suggestions as to what the cause of this may be? Have tried both default and legacy build systems.

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [July 20, 2021, 11:01am UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/4 "2021-07-20T11:01:49Z")

</div>

I’m seeing the same thing as you in Xcode 12. It’s been a while since I looked at this project. Looks like it’s not linking the library, but I’ve not worked out what setting is required to make that happen again. I’ll report back if I find the issue!

---

<div class="post-metadata">

**Author:** ![lukasroberts](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@lukasroberts](https://forum.juce.com/u/lukasroberts)\
**Post date:** [August 6, 2021, 9:13pm UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/5 "2021-08-06T21:13:44Z")

</div>

Hey Adam

Did you manage to get anything figured out with this? I’m about to get started having a go with the same sort of mix, so would be good to know before I dive deep.

Best

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [August 6, 2021, 9:15pm UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/6 "2021-08-06T21:15:27Z")

</div>

No, I haven’t made time for it, been absorbed in plugin development! I’m sure its a simple fix, as it’s been working well in previous versions of Xcode.

---

<div class="post-metadata">

**Author:** ![lukasroberts](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@lukasroberts](https://forum.juce.com/u/lukasroberts)\
**Post date:** [August 6, 2021, 9:20pm UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/7 "2021-08-06T21:20:46Z")

</div>

I’ll have a bit more of a look then and report back

---

<div class="post-metadata">

**Author:** ![patterncrossing](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/patterncrossing/32/13353_2.png) [@patterncrossing](https://forum.juce.com/u/patterncrossing)\
**Post date:** [May 5, 2022, 4:38pm UTC](https://forum.juce.com/t/juce-wrapper-for-swiftui-project/46931/8 "2022-05-05T16:38:44Z")

</div>

```auto
Undefined symbols for architecture arm64

```

Are you using an Intel-based Mac and compiling to run in the simulator? If so, you need a version of your JUCE library compiled for x86. It’s possible to create an xcframework that bundles both the x86 and arm64 versions of your library, and Xcode can figure out which one to use.

Or are you running on an iOS device or in the simulator on one of the newer Apple M1-based Macs? Because those are built on an arm64 architecture. If that’s the case, I don’t know what’s going on.
