iOS Build fails with ResonanceAudio Plugin

I would like to use the ResonanceAudio Plugin on my iOS and Android Unity project. The Android build succeeds, but the iOS build fails. I can build the project in Unity but when I build the iOS app in Xcode, it fails:

Undefined symbols for architecture arm64:
  "_FMOD_ResonanceAudioSource_GetDSPDescription", referenced from:
      _FMOD_Unity_RegisterStaticPlugins in fmod_register_static_plugins.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Unity 2020.2.2f1
Xcode 12.5
macOS Big Sur 11.2.3 / Apple M1 Silicon (but Build also fails in Unity Cloud Build)
FMOD 2.01.06

FMOD Settings:
Static Plugin: “FMOD_ResonanceAudioSource_GetDSPDescription”
Dynamic Plugin: “resonanceaudio”

I have iOS & Android platforms set to inherit both plugin settings… should my plugin setup be different?

I see the resonanceaudio plugin in the various platform library folders:
image

I followed the instructions on the ResonanceAudio webpage to uncomment some methods in the fmodplugins.cpp file (is this still required?)

I’m not sure what I did wrong, and any help setting up the ResonanceAudio plugin with the FMOD Unity integration would be much appreciated, thanks!

2.01.06 has known issues with this, please update to the latest 2.01 version.

You don’t need to use fmodplugins.cpp anymore, the new way is via the editor UI:
FMOD - Plugins (static plugins)

Thanks Matthew. I upgraded to 2.01.09, and I did set the plugin via the editor, but I’m still getting the same error message when building.

Is resonanceaudio the correct value to put for the Dynamic Plugin? The file under android and iOS is libresonanceaudio.

Is FMOD_ResonanceAudioSource_GetDSPDescription the correct value to put for the Static Plugin? Do I also need to add FMOD_ResonanceAudioListener_GetDSPDescription and FMOD_ResonanceAudioSoundfield_GetDSPDescription as static plugins as well?

In the error message, there is a leading underscore whereas the static plugin value from the documentation has no leading underscore. Do I need to update one or the other?

Undefined symbols for architecture arm64:
  "_FMOD_ResonanceAudioSource_GetDSPDescription", referenced from:
      _FMOD_Unity_RegisterStaticPlugins in fmod_register_static_plugins.o
ld: symbol(s) not found for architecture arm64

In the documentation, there are instructions about including a static library or code:

Static plugins must be statically linked into the executable. You can implement this by including source code or static libraries in your Unity project.

Is that provided in the FMOD Unity package for the ResonanceAudio Plugin, or do I need to include either additional code or libraries?

Is resonanceaudio the correct value to put for the Dynamic Plugin?

Yes the base name is correct, no prefix or suffix, with each platform we implement the decoration that goes around the name, i.e. for Android it’s lib{0}.so

Is FMOD_ResonanceAudioSource_GetDSPDescription the correct value to put for the Static Plugin? Do I also need to add FMOD_ResonanceAudioListener_GetDSPDescription and FMOD_ResonanceAudioSoundfield_GetDSPDescription as static plugins as well?

Yes, you need all three symbols in the static plugins list.

In the error message, there is a leading underscore whereas the static plugin value from the documentation has no leading underscore. Do I need to update one or the other?

You shouldn’t need to add an underscore.

Is that provided in the FMOD Unity package for the ResonanceAudio Plugin, or do I need to include either additional code or libraries?

The resonance libraries are included in our Unity package and are configured for use, there should be no additional steps required.


Edit:

I’ve done some testing and I’ve been able to reproduce the problem you are seeing. It looks like the version of resonance audio included in the Unity package has not been updated to match the new static plugin system. This was possibly done to avoid breaking compatibility for existing developers.

You should be able to work around this by removing all static plugins from the FMOD settings UI and modifying fmodplugins.cpp. This is the legacy method, you need to uncomment the register lines relevant to Resonance and you should be back in business.

Sorry for the confusion.

Thanks Mathew! The legacy fix (change fmodplugins.cpp; don’t list static plugins in FMOD settings UI) worked great… thanks so much for your help!

Glad to hear it, we’ll investigate making the new way work in a patch.

Hi @mathew. Sorry to bump an older thread, but just wondering whether this was ever implemented? We just updated from 2.01.05 to 2.01.11, and had to implement this change in order to get our iOS builds working.

I believe this was fixed in 2.01.12, one version after the one you are using.

1 Like