Question

When opening the ObjectieGitFramework.xcodeproj file I can now build the iOS scheme successfully. A whole lot of experimenting was required though. Lets start from the beginning – how I did that.

What I did:

First I cloned a fork of ObjectiveGit.

git clone git@github.com:Eonil/objective-git.git --recurse-submodules
cd objective-git
cd ./Scripts/libgit2-make-ios/; sh ./download-make-clean-deploy.sh "./../../libgit2.a"; cd ../..

Src: https://github.com/libgit2/objective-git/pull/54

Opening the project and building now results in one error and one warning. I let Xcode automatically update the project settings to solve the warning. Errors

Now I go to the libgit2 directory and build using cmake:

$ mkdir build && cd build
$ cmake ..
$ cmake --build .

Src: https://github.com/libgit2/libgit2

This result, among other things, in the libgit2.0.15.0.dylib file being created. Image of the file in finder

I drag it into the Xcode and add it to ObjectiveGit and the iOS target. Now I go to the build phases tab for ObjectiveGit-iOS and make it look like this:

enter image description here

The problem

At this moment I could build the project, and I could create classes within it successfully using the ObjectiveGit. However when I dragged the project inside another project, added ObjectiveGit-iOS as a target dependence and added libObjectiveGit-iOS.a in link binary with libraries I couldn't import ObjectiveGit/ObjectiveGit.h plus I was getting some other weird errors (see images below). I know very little about libraries in xcode so I don't know at all why this is not working.

enter image description here enter image description here

Now, this is an error I got once but not anymore. I don't know what I was doing to cause it. enter image description here

Update

 $(SRCROOT)/frameworks/ObjectiveGit/Classes
 $(SRCROOT)/frameworks/ObjectiveGit/libgit2/include
 $(SRCROOT)/frameworks/ObjectiveGit/Classes/Categories

When adding this to header search path something strange happens. It result in no files not being found, but 70 other Mach-o errors instead.

```

Was it helpful?

Solution

Dynamic Libraries are not supported by iOS. You have to use static libraries.

To be clear: Of course iOS supports dynamic libraries, but only these which are distributed by apple.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top