3

XCode 6.3.2 CocoaPods 0.37.2 KissXML 5.0

I'm having a difficult time getting KissXML to compile as a pod after updating from CocoaPods 0.35.0.

I get a ton of errors like this:

Error:(2, 9) 'libxml/tree.h' file not found with include; use "quotes" instead

I have both a Mac and iOS project that share code, and they both fail in the same way. If I reinstall 0.35.0, they build just fine.

I should mention that I do a have a subclass of DDXMLDocument defined in my application as well as a category on DDXMLElement.

I've tried to create a smaller project that demonstrates the issue, but haven't been able to create one that fails in the same way, so it must be something unique to my project.

Anyone have any ideas where to look?

Bruce

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "7.1"
inhibit_all_warnings!
pod 'BButton'
pod 'CocoaAsyncSocket'
pod 'CocoaLumberjack'
pod 'CSNotificationView'
pod 'Dropbox-iOS-SDK'
pod 'HockeySDK'
pod 'KissXML'
pod 'MBProgressHUD'
pod 'MMMarkdown'
pod 'Reachability'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod 'SWRevealViewController'
pod 'UIDevice-Hardware'
Ekta Padaliya
  • 5,743
  • 3
  • 39
  • 51
bvanderw
  • 1,065
  • 2
  • 12
  • 20
  • What is your Podfile? Since 0.36.0 CocoaPods requires explicitly specified source in the Podfile. See here http://stackoverflow.com/questions/29034126/cocoapods-private-unable-to-find-specification/29034994#29034994 – Jakub Vano Jun 01 '15 at 13:03
  • Not the issue, I'm afraid. Edited to include Podfile. – bvanderw Jun 01 '15 at 16:57
  • 1
    Where do you import the interface file? it seems you are importing it in the wrong way – Luca D'Alberti Jul 21 '15 at 14:15
  • I know you said the Podfile wasn't the issue, but I've seen this happen when `use_frameworks!` isn't included in the Podfile. Maybe that could cause this? – Cole Jul 27 '15 at 22:15
  • Is it a swift project ? – Loegic Jul 28 '15 at 09:59

3 Answers3

1

You have to add -lxml2 to the OTHER_LD_FLAG in the target build setting as well as adding $(SDKROOT)/usr/include/libxml2 to the HEADER_SEARCH_PATHS of the target.

Clean & build again, it should work

Loegic
  • 3,390
  • 20
  • 33
0

Using this Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "7.1"

target 'KissXML' do
pod 'BButton'
pod 'CocoaAsyncSocket'
pod 'CocoaLumberjack'
pod 'CSNotificationView'
pod 'Dropbox-iOS-SDK'
pod 'HockeySDK'
pod 'KissXML'
pod 'MBProgressHUD'
pod 'MMMarkdown'
pod 'Reachability'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod 'SWRevealViewController'
pod 'UIDevice-Hardware'
end

succeeding with these Pods:

Installing BButton (4.0.2)
Installing CSNotificationView (0.5.4)
Installing CocoaAsyncSocket (7.4.1)
Installing CocoaLumberjack (2.0.1)
Installing Dropbox-iOS-SDK (1.3.13)
Installing HockeySDK (3.7.1)
Installing KissXML (5.0)
Installing MBProgressHUD (0.9.1)
Installing MMMarkdown (0.4.3)
Installing Reachability (3.2)
Installing Reveal-iOS-SDK (1.5.1)
Installing SWRevealViewController (2.3.0)
Installing UIDevice-Hardware (0.1.5)

with the addition of this Bridging-Header.h

#import "DDXML.h"

...I successfully can create, link, build and run a DDXMLDocumentSubclass in Swift:

import UIKit

class DDXMLDocumentSubclass: DDXMLDocument {
    // ...
}

...and a category in Obj-C:

//  DDXMLElement+Convenience.h
#import "DDXMLElement.h"
@interface DDXMLElement(Convenience)
    // ...
@end
SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179
  • I stand by this response: having a dangling `USER_HEADER_SEARCH_PATHS` is **not a valid response** to `Issue with CocoaPods 0.37.2 and KissXML 5.0`. It is a response to **My project does not build because I broke it**. Creating a clean project with a clean set of Pods will solve that and all sort of other Xcode project corruption. – SwiftArchitect Jul 28 '15 at 19:27
0

None of the answers were correct or needed, but thanks for the responses.

Turns out the issue was a recursive reference to the Pods folder had been added to either the project or target USER_HEADER_SEARCH_PATHS.

I thought maybe this was an artifact from an older version of CocoaPods...until AppCode almost immediately prompted me to re-add it.

bvanderw
  • 1,065
  • 2
  • 12
  • 20
  • 1
    May I kindly suggest you rephrase your question? A recursive `USER_HEADER_SEARCH_PATHS` is in no way related to `CocoaPods` or `KissXML`. To some extent, mentioning these two technologies alongside your **corrupted project** question may be *harmful* and *misleading*. – SwiftArchitect Jul 28 '15 at 19:32