6

I have added GitHub's Mantle project to a iOS 6 project using CocoaPods:

$ pod search Mantle
$ vim Podfile // here I added pod 'Mantle'
$ pod install // this installs Mantle 1.0 

Then I have added the ($inherited) variable to the Header Search Paths of project's 'Build Settings' section, before my custom search paths. When importing the Mantle header file Xcode complains with

#import "Mantle.h" // => 'Mantle/MTLJSONAdapter.h' file not found

Am I missing some step? I have other pods installed as well (AFNetworking and SSKeychain) but only Mantle is giving me issues.

I have also added SSToolkit but following the instructions on its 'Getting started', i.e. not using CocoaPods.

akashivskyy
  • 44,342
  • 16
  • 106
  • 116
elitalon
  • 9,191
  • 10
  • 50
  • 86
  • I don't know if I should answer or comment. Nothing worked at first, so I went to manually install like MailCore or any other library. Also failed, then I noticed this line: "Mantle requires submodules so it is not supported via CocoaPods officially". So basically, unless you get lucky, you have to use git to add it, then init submodules. or copy from a dir that has the submodules I would bet. – Stephen J Apr 04 '17 at 18:50

3 Answers3

5

Since the problem seemed to be related with the Xcode project/workspace configuration I tried all kind of 'cleaning' solutions:

  1. Delete the Pods directory, the Podfile.lock file and install everything from scratch.
  2. Delete the MyProject.xcworkspace directory and repeat step 1
  3. Enter MyProject.xcodeproj, delete project.xcworkspace and xcuserdata directories and repeat step 1.
  4. Go to the global Xcode directory (/Users/my_user/Library/Developer/Xcode), remove everything related to the project, specially the DerivedData subdirectory, and repeat step 1.

The final step seems to be the final solution, though I cannot tell which file/folder removal did the trick.

elitalon
  • 9,191
  • 10
  • 50
  • 86
1

Have you added Mantle to your Podfile? You mention running pod install Mantle which doesn't/shouldn't do anything but show an error. ([!] Unrecognized argument:Mantle'`)

After you add Mantle to your Podfile and run pod install you should be able to link Mantle.h directly and there will be a few directories in your xcworkspace and the Pods project. After this you can use #import "Mantle.h" no issues.

Example

Keith Smiley
  • 61,481
  • 12
  • 97
  • 110
  • Sorry, that was a copy-paste typo. I have `pod 'Mantle'` added to my Podfile and the command is just `pod install`. – elitalon Mar 18 '13 at 14:38
  • @elitalon ok good. Does your `Pods` project look like the screenshot? – Keith Smiley Mar 18 '13 at 14:41
  • Yep, I have a Mantle group below Pods just as your screenshot. In fact, I have other pods installed as well (AFNetworking and SSKeychain). Only Mantle is giving me issues – elitalon Mar 18 '13 at 14:43
  • @elitalon try deleting your `Podfile.lock` and the `Pods` folder. Then run `pod install` again. – Keith Smiley Mar 18 '13 at 17:47
  • No success either. I'm thinking of adding Mantle by hand as with SSToolkit if this continues to give problems – elitalon Mar 18 '13 at 18:07
  • @elitalon that's very strange since it worked perfectly for my install. What are your issues with SSToolKit? – Keith Smiley Mar 18 '13 at 18:11
  • @elitalon try removing the build flag you added. You shouldn't need that with Cocoapods – Keith Smiley Mar 18 '13 at 18:13
  • 1
    I have no issues with SSToolkit, just followed the 'Getting started' guide to add it instead of using Cocoapods: http://sstoolk.it/#getting-started But I had to add `MyProject/Vendor/SSToolkit` instead of `Vendor/SSTolkit` – elitalon Mar 18 '13 at 18:16
0

I had the same problem, but the problem appears to simply be that my Mantle pod was too old. Changed version to '2.0.5' and pod updated, things work fine.

Cesar
  • 2,027
  • 2
  • 18
  • 29