Search code examples
iosocunitnewreliccocoapods

NewRelicAgent does not work with OCTesting


I have a problem with the NewRelicAgent pod. It works fine with the nomral app targed und runs well in the simulator, but as soon as I start the test target, I get the the following error message:

ld: framework not found NewRelicAgent
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My pod file looks like this:

platform :ios, '5.0'

pod 'RestKit', '~> 0.20.0rc'

pod 'RestKit/Testing', '~> 0.20.0rc'

pod 'RestKit/Search', '~> 0.20.0rc'

target :test do

    link_with :DealiniTests

    pod 'Expecta', '0.2.1'

end

pod 'GoogleAnalytics-iOS-SDK', '~> 2.0beta4'

pod 'NewRelicAgent', '~> 1.328.0'

pod 'Parse', '~> 1.2.9'

I think the problem is, that the PATHS links to a path "{PODS_ROOT}/BuildHeaders/NewRelicAgent" which does not exsits. I have no NewRelicAgent folder in the Headers and BuildHeaders folder but it does work for the normal target just for the test target not.

All other pods works fin just the newrelic does not work.


Solution

  • The Problem is, that CocoaPods does not automaticly add the NewRelic framework to the

    FRAMEWORK_SEARCH_PATHS

    I just added "$(PODS_ROOT)/NewRelicAgent/NewRelic_iOS_Agent_1.328" to the FRAMEWORK_SEARCH_PATHS of the test target and it worked