I bet my problem is very basic, so please excuse me as I'm not that experienced with Xcode, since I work in Unity and use ready plugins for our iOS projects, so not really needed to go deep in Xcode until now.
I want to write a very basic custom plugin, but cannot get Xcode to accept it. I followed the tutorial found on the Unity page, and added my .h and .m files to Assets / Plugins / iOS, where (as the tutorial states) they will be merged automatically into Xcode.
After building, Xcode throws two errors: *"Undefined symbols for architecture armv7: "__XY", referenced from: __Z19RegisterMonoModulesv in RegisterMonoModules.o"* And the same for armv6.
As I read in similar issues here, this is because the files are not added to the Xcode project, despite the fact, that they should be added automatically. In Xcode, I can see both my files in the Project Navigator. I also see my .mm file in the Build Phases list.
What's the problem?
Build the app by going to File -> Build Settings, selecting iOS and clicking Build. Unity will build the selected scenes and produce an XCode project in the selected folder. Depending on your versions of Unity and Xcode, you may be able to select Build and Run instead.
Unity is one among the Microsoft Application Blocks. It is basically introduced as an IOC container by Microsoft, which helps in easy object creation and de-coupling the module dependencies in your project. To use it, just add the reference of the Unity DLLs to your project.
Part 2: Embed Unity in the iOS project. Download the Unity folder and copy all the items inside it to the Unity folder under the Xcode target folder. Open . xcworkspace in the project navigator, drag the Unity folder you just downloaded to your target.
Simply building the Unity project will build for iOS device and simulator, and link those build products in the Swift project. From there, the native Swift code can present or dismiss the Unity scene just like any other view controller.
Looks like you're having a linker error. If your files show up in XCode and in your Build Phase list, then make your #include statements are all in order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With