- Home /
XCode Swift Compiler Error Use of Unresolved Identifier "UnitySendMessage" how to fix?
Hello! Please help with my problem.
I'm having trouble solving this swift compiler errors. Especially UnitySendMessage(). Am I missing a plugin or import? Please give me a way how to fix it Been stuck with it for days. Thanks you!
Answer by jtok4j · Aug 06, 2021 at 12:34 PM
In case anyone was curious as to the "Answer" which failed to include a link to their answer, and instead spammed a link to a spam video site (Big Boss 14)
https://answers.unity.com/questions/1714482/unity3d-project-failed-to-build-for-ios-macos-cata.html ^ There is the link to the mentioned article, but it also doesn't include a fix or an answer.
(After a few hours of searching/testing...........)
FOUND IT: https://github.com/jwtan/SwiftToUnityExample#swift-to-unity-ios-example
The answer is in the "Umbrella Heading" section. Simply read the instructions, to configure the different files in the project, and after that, no more complaints about not being able to understand, "UnitySendMessage". :)
Thanks! This worked for me. I used modulemap method from the second link.
Answer by Shaundev · Sep 10, 2020 at 07:09 PM
Hi, did you manage to find a solution for this? This post talks about the issue: https://forum.unity.com/threads/swift-ios-native-plugins-hurdles.802623/
Look for where it says:
"you need to write an objective-c wrapper class, that you call SendMessage from, and then use your wrapper class in your swift code. Since you can't include the UnityInterface.h file in the swift code"
I'm trying to do this part myself, if you have an example of the objective-c wrapper class needed to fix this it'd be great if you could share it here!
Hello shunshun, I didn't fixed the problem yet. If you already fixed, please share it with me, badly need other dev's help, Thank you
hey @ferrer_unity I had to stop spending time on this but will be looking at it again next week, I'll post on here when I've got some answers
Your answer
Follow this Question
Related Questions
Unity iOS build error 0 Answers
Unity Build ios Xcode unity version missing error 0 Answers
Building to IOS 2 Answers