How to integrate Unity inside native iOS App? - ios

I'm having troubles integrating a simple Unity project inside a native iOS App.
I followed this this tutorial but I think that some things have changed since it was written. I'm stuck with this error:
And thats not the only one, there are 1600 files that include include that file. The problem is that all this 1600 files have a wrong reference to il2cpp-codegen.h
This are my build settings for the Unity project:
So, after following all the tutorial, should I change all the files so that all the references would be correct? Or am I missing something else?
Thanks!
Joel
EDIT
I'm currently using Unity 5.1.1f1 Personal version.

Do you have a warning saying folder not found or something like it?
I think you didn't set the path for Libraries/libil2cpp/include in your header search paths.

You probably didn't copy the Libraries/libil2cpp folder.
That folder isn't visible inside the Xcode project but you can find it in Finder. You should try and copy that folder also and maybe add it to the Build Phases in Xcode. Not sure about this last step.

Related

opencv cmake files, how to use them in iOS

These stuff stuck me another 3 days to figure out.
I'm implementing opencv and I need to use xfeatures2d module in objc xcode. I previously downloaded the opencv.framework and successfully imported it in my iOS project and it works. But there is no xfeatures2d in it. So then I finally figured out that it is an extra module and it is in a package call opencv_contrib.
To make use of it, it seems like people recommend to use cmake to build the source code of opencv-master with opencv-contrib-master
I did it, and it looks build correctly. And I got lots of funky things in my folder. However, it seems like nothing I can use to #import to my .xcodeproj project. (Sorry I can't embed my screenshot yet.)
So did I do something wrong? Or,is it the correct way to build the file I need??
Please help, Thanks!
Finally I found a solution. #thachnb 's solution is referred from here. This instruction guide you to generate an opencv2.framework in use of your iOS project from the opencv-master package. If you want to use the modules in opencv_contrib, you need to physically copy the module from opencv_contrib(in my case is xfeatures2d, or you can just copy everything over), to opencv-master/module, and then use
python opencv/platforms/ios/build_framework.py ios
command to compile it. After this compilation, you will have a opencv2.framework containing everything you need. This also helps.
Thanks #thachnb !
Q1. Did you run below command?
python opencv/platforms/ios/build_framework.py ios
if yes, move to question 2
Q2. Did you see opencv.framework in ios subfolder?
if yes, move to question 3
Q3. Did you add that opencv.framework folder to your xcode project? or drag and drop it to Framework folder of your xcode project?

How do I include a framework in my xcode project if I want to send it as zip

Sorry this is somewhat a silly question, but I could do with some help with this.
Basically my app uses various Google Frameworks (maps, places etc). But when I compress my project and send it it stops working. I've included all the frameworks in the root folder of my project, here's the errors i'm getting:
Now when I look in at the framework in the left panel of xcode, it appears like this:
The headers have gone!
Here's how it should look:
Why is this happening?
I believe this is because your framework's directory isn't referenced properly. Go to your target -> Build Setting -> Search Path -> Framework Search Path and fix it accordingly.
However I would recommend you use a package manager like cocoapods as it will allow others to download all the frameworks necessary separately, and also it will allow you to easily update the frameworks to its latest version.
Have you done this while adding the framework?(like the image added)

Xcode Project cannot build after adding iOS Charts Framework (Info.plist not found)

I recently added the iOS-Charts framework to my Xcode Project. The project would build before I added the framework to my project, but will not afterwards. I am not even using any of the framework's features yet, it is not imported anywhere, I have just added it in embedded binaries according to the instructions here.
The build fail message: could not read data from .../AppName/Supporting Files/Info.plist': The file "Info.plist" couldn't be opened because there is no such file.
This does not make sense because nothing has been moved and if I remove the framework from the embedded binaries section the project does build.
Help will be much appreciated, thank you.
The error message has said clearly: The file "Info.plist" couldn't be opened because there is no such file. When you see this, double check the Info.plist file in your disk, to make sure it does exists.
If you removed the library and it start building again, it's more like the Info.plist is modified but broken. You may want to google and do some testing, like creating a new project and import the library to give a try. If the new project has the same issue, file an issue on its github page.
Turns out the project file for iOS Charts was moved when I was setting it up. The project file had to be dragged into the Xcode interface, not actually moved into the project directory.
I have met the same problem with you, as it said "no such file", and it provides the path of it. So I realized that I forget to copy "Supporting Files" to folder.
Notice the file in this screenshot:
the missing Info.plist
Then in your project: TARGET -> Building Settings -> Packaging -> Info.plist File
By the way, due to the bug of Xcode, you should build before import Charts.
Good Luck!

xCode can't find header files in Unity3D project

I'm building an iOS app using unity3D. Everything goes ok until I try to build the solution. Unity builds the xCode project with 0 problems but then, when I try to build with xCode, I get several, all of them the same: "*.h not found".
The problem in this is that the headers don't exist in the project folder, but in the original-unity project folder they do exist.
I've seen a lot of similar problems around the web, but most of them relate to independent xCode projects, being the solution messing with the paths and so on... But with a project built by unity is it supposed to change that? When I go check them, they seem correct...
I've also seen that unity had a problem and by reinstalling it would fix the problem. Unfortunately it didn't...
Does anyone know what kind of problem is this? Should I change the build paths even though unity set them some way? Is it unity's fault?
Thank in advance
Native plugins need to be stored in special folder Plugins, for iOS it is Assets/Plugins/iOS. Citing from Unity - Building Plugins for iOS:
Automated plugin integration
Unity iOS supports automated plugin integration in a limited way. All files with extensions .a,.m,.mm,.c,.cpp located in the Assets/Plugins/iOS folder will be merged into the generated Xcode project automatically. However, merging is done by symlinking files from Assets/Plugins/iOS to the final destination, which might affect some workflows. The .h files are not included in the Xcode project tree, but they appear on the destination file system, thus allowing compilation of .m/.mm/.c/.cpp files.
Note: subfolders are currently not supported.
I marked the subfolders statement bold as I ran into trouble with this some time ago :)

FMDatabase.h not found when using route-me library

So im trying to use the route-me widget in my app, but xcode keeps complaining that it cant find FMDatabase.h, yet its included in the project (albeit under a different project that is included into my project). I've copied how a sample app has been made yet the sample project doesnt get this error. The RMDBMapSource.h file is contained within the MapView project, so i shouldn't need to include the fmdb stuff myself (and because the sample project doesn't do that)
Surely if the files are under compile sources / copy headers under build phases, that means it should be able to find the file? This is a pretty lackluster explanation of my problem, but if anyone has used the route-me library before maybe they have had the same problem and can point me in the right direction
Resolved my own mistake. First off in the build settings of the main project, the 'search for header paths' was not set correctly, it was set to /MapView/ instead of /MapView/** that resolved the FMDatabase.h missing error.
Then in case someone else had a linker error like i did after i resolved the first issue, make sure you have libMapView.a included in your link binary with libraries section. (i had it their before, but during a version control commit, somehow our project file decided to not add that library anymore and i had totally forgotten about it, so took me quite a while to find out that it was missing)

Resources