- Home /
GVR Audio Renderer not found iOS
I am tinkering with the sample project "SpatialAudio" from Google VR SDK for Unity, to implement it in iOS. I built it in Unity using the latest GVR SDK, so I had to replace a few deprecated keywords (GvrAudioSource instead of CardboardAudioSource, etc.) If I build it in Xcode just as Unity gives it to me, it runs fine in the physical device. Then, I tried to edit the Unity-generated file 'main.mm' to change the default App Controller (UnityAppController) to a new one, let's call it NewAppController.
// main.mm
...
const char* AppControllerClassName = "UnityAppController";
...
//UIApplicationMain(argc, argv, nil, [NSString stringWithUTF8String:AppControllerClassName]); // old
UIApplicationMain(argc, argv, nil, [NSString stringWithUTF8String:"NewAppController"]); // new
NewAppController is a class which inherits from UnityAppController and does not override any of its methods or properties, like this:
@interface NewAppController : UnityAppController
@end
@implementation NewAppController
@end
I thought that it should work exactly the same as before, but now I get the following warning in runtime: "Audio effect GVR Audio Renderer could not be found. Check that the project contains the correct native audio plugin libraries and that the importer settings are set up correctly."
Everything else works just fine: I can see the video and even hear the sounds, but only they are not 'spatialized'.
I am using: GVR SDK 1.1, Unity 5.5.0f3, iOS 10.1.1
I found the solution. I was missing two important things: First, messing with main.mm causes a lot of trouble. The correct approach for defining a custom App Controller is to create a subclass of UnityAppController and adding the macro I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS(name_of_the_class) at the bottom of its .mm file. Second, Unity automatically generates a custom app controller, called CardboardAppController, which is located in the build directory, under 'Libraries/Plugins/iOS'. One of its functions is registering the unity audio effect plugin. I was bypassing this file without knowing, causing the audio renderer to not initialize properly. So my solution was to comment out the macro at the end of the file CardboardAppController.mm (line 71):
//I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS(CardboardAppController)
And defining the new custom controller as a subclass of CardboardAppController:
#import "CardboardAppController.h"
@interface NewAppController : CardboardAppController
@end
@implementation NewAppController
@end
I$$anonymous$$PL_APP_CONTROLLER_SUBCLASS(NewAppController)
Your answer
Follow this Question
Related Questions
Xcode linker error lists methods that should exist 0 Answers
App Store size almost 15 times more then iPA 0 Answers
linker command failed with exit code 1 (use -v to see invocation) unity 5.5 to xcode 8 0 Answers
IOS Build settings IL2CPP disabled, Xcode error "Undefined symbol: _UnityPluginUnload" 1 Answer
Unity XCode build linker error 0 Answers