Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add files to Xcode project? (writing Unity plugin)

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?

like image 404
user1634098 Avatar asked Aug 29 '12 18:08

user1634098


People also ask

How do I run Unity project on Xcode?

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.

What is Unityframework?

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.

How do I embed Unity framework into native iOS app?

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.

Can you use Swift in unity?

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.


1 Answers

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.

like image 164
cjcurrie Avatar answered Oct 05 '22 21:10

cjcurrie