Note that there are some explanatory texts on larger screens.

plurals
  1. POIncluding ObjectiveGit library in iOS app
    text
    copied!<p>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.</p> <p><strong>What I did:</strong></p> <p>First I cloned a fork of ObjectiveGit.</p> <pre><code>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 ../.. </code></pre> <p>Src: <a href="https://github.com/libgit2/objective-git/pull/54" rel="nofollow noreferrer">https://github.com/libgit2/objective-git/pull/54</a></p> <p>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. <img src="https://i.stack.imgur.com/g4MPe.png" alt="Errors"></p> <p>Now I go to the <code>libgit2</code> directory and build using <a href="http://www.cmake.org/" rel="nofollow noreferrer">cmake</a>:</p> <pre><code>$ mkdir build &amp;&amp; cd build $ cmake .. $ cmake --build . </code></pre> <p>Src: <a href="https://github.com/libgit2/libgit2" rel="nofollow noreferrer">https://github.com/libgit2/libgit2</a></p> <p>This result, among other things, in the <code>libgit2.0.15.0.dylib</code> file being created. <img src="https://i.stack.imgur.com/hU9nS.png" alt="Image of the file in finder"></p> <p>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:</p> <p><img src="https://i.stack.imgur.com/SbzNG.png" alt="enter image description here"></p> <p><strong>The problem</strong></p> <p>At this moment I could build the project, and I could create classes within it successfully using the <code>ObjectiveGit</code>. However when I dragged the project inside another project, added <code>ObjectiveGit-iOS</code> as a target dependence and added <code>libObjectiveGit-iOS.a</code> in <code>link binary with libraries</code> I couldn't import <code>ObjectiveGit/ObjectiveGit.h</code> 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.</p> <p><img src="https://i.stack.imgur.com/28Mqf.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/yxbfU.png" alt="enter image description here"></p> <p>Now, this is an error I got once but not anymore. I don't know what I was doing to cause it. <img src="https://i.stack.imgur.com/UmEVS.png" alt="enter image description here"></p> <p><strong>Update</strong></p> <pre><code> $(SRCROOT)/frameworks/ObjectiveGit/Classes $(SRCROOT)/frameworks/ObjectiveGit/libgit2/include $(SRCROOT)/frameworks/ObjectiveGit/Classes/Categories </code></pre> <p>When adding this to <code>header search path</code> something strange happens. It result in no files not being found, but 70 other Mach-o errors instead.</p> <p>```</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload