Value of type 'UnityAppController' has no member 'unityMessageHandler'
Describe the bug I am past the steps of compiling unity an trying to run the app. Xcode gives me the following message: "Value of type 'UnityAppController' has no member 'unityMessageHandler'"
**Screenshots**
Unity (please complete the following information):
- OS: iOS 14.0
Smartphone (please complete the following information):
- Device:iPhone 12 pro
- OS: 14.0
I got the same problem and did find out, that sometimes export did not generate proper AppController class.
What i mean is that the changes that are needed for this package are missing.
Just copy those files to your project ( xxxx/ios/unitylibrary/classes/) and it should be fine. Updated_unity_classes.zip
If you check then you see that there are additional exports which the properties that you need.
I had the same issue. Did you find the solution for it @faridg18 ? Copying the files that @camao-apo provided gave me new compiler error, line 454 in UnityAppController.mm "Use of undeclared identifier 'UnityDisplayLinkCallback'"
I have the same issue, did anyone solve it?
So it seems that export from Unity did not went well.
Two questions:
- What version of Unity you are using ?
- Do you use DisplayLink capabilities ?
- 2019.4.27f1
- As far as I know no (no idea what that is)
ok, here's the solution for those that are not able to read the instructions (including myself):
DO NOT USE THE REGULAR BUILD OPTION WITHOUT THE FLUTTER UNITY PLUGIN!
There is a reason for the existence of this plugin, and it is mandatory to do the export for Android and iOS via the "Flutter" menu.
Just for reference, if you are working on the Unity part and you want to "append" instead of build anew, you might have to fix the Build.cs file in the Plugin like this (just in case the "append" function does not work for you).
For iOS, replace this line in DoBuildIOS() -
var options = BuildOptions.AcceptExternalModificationsToPlayer;
with
var options = BuildOptions.AllowDebugging;
For Android, replace this line in DoBuildAndroid() -
var options = BuildOptions.AcceptExternalModificationsToPlayer;
with
var options = BuildOptions.AllowDebugging;
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
The issue has been asked and answered here: https://github.com/juicycleff/flutter-unity-view-widget/issues/377
It's an error that's occurring when you're exporting the iOS project from Unity using an older FlutterUnityIntegration package. Use this one (v4.1.0): https://github.com/juicycleff/flutter-unity-view-widget/blob/master/scripts/FlutterUnityIntegration-v4.1.0.unitypackage
You'll know that it's exported correctly when your UnityAppController.h file contains these changes: https://github.com/juicycleff/flutter-unity-view-widget/issues/377#issuecomment-831712697
NOTE: Be sure to follow the steps mentioned in the above comment by @belveder79 in order to export iOS without errors.
I just found a reliable way to replicate this error.
Reproduction
- Set the build target in Unity build settings to anything NOT iOS, like Android or Desktop.
- Now click Flutter-> Export iOS.
This results in an incomplete build, because any code in
#if UNITY_IOS blocks is skipped.
However you still see the build successful message.
The build script will change the buildtarget automatically, but somehow the #If UNITY_ keeps the old value.
Current solution
Change the Unity build target before clicking Flutter -> Export.
If you use batchmode or command line, make sure to include -buildTarget iOS in your command.