3

I'm have a great issue with our private podspec, all worked fine until we updated to cocoapods 0.35.

The spec is not very complex, but is depended on the GoogleAnalytics-iOS-SDK This is our pod spec:

{
  "name": "RKTagManager",
  "version": "0.0.1",
  "summary": "Google TagManager wrapper.",
  "license": {
    "type" : "Closed Source",
    "text" : "This library is as is, not warrenty of any kind."
  }
  "platforms": {
    "ios": "5.1.1"
  },
  "requires_arc" : true,
  "source": {
    "hg": "<snip",
    "revision" : "RKTagManager-0.0.1"
  },
  "dependencies": {
    "GoogleAnalytics-iOS-SDK": []
  },
  "source_files": [
      "Source/RKTagManager/*.{h,m}"
  ]
}

When I try to validate it the compiling failed with the following message:

Ld /var/folders/9r/y21mxssd6rgf6gbrlhqsqv5m0000gp/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Pods-RKTagManager.build/Objects-normal/i386/RKTagManager normal i386
    cd /var/folders/9r/y21mxssd6rgf6gbrlhqsqv5m0000gp/T/CocoaPods/Lint/Pods
    export IPHONEOS_DEPLOYMENT_TARGET=5.1.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/<snip>/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk -L/var/folders/9r/y21mxssd6rgf6gbrlhqsqv5m0000gp/T/CocoaPods/Lint/build/Release-iphonesimulator/Pods -F/var/folders/9r/y21mxssd6rgf6gbrlhqsqv5m0000gp/T/CocoaPods/Lint/build/Release-iphonesimulator/Pods -filelist /var/folders/9r/y21mxssd6rgf6gbrlhqsqv5m0000gp/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Pods-RKTagManager.build/Objects-normal/i386/RKTagManager.LinkFileList -install_name @rpath/RKTagManager.framework/RKTagManager -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1.1 -framework Foundation -framework GoogleAnalytics_iOS_SDK -framework OIFoundation -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /var/folders/9r/y21mxssd6rgf6gbrlhqsqv5m0000gp/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Pods-RKTagManager.build/Objects-normal/i386/RKTagManager_dependency_info.dat -o /var/folders/9r/y21mxssd6rgf6gbrlhqsqv5m0000gp/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Pods-RKTagManager.build/Objects-normal/i386/RKTagManager
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_TAGManager", referenced from:
      objc-class-ref in RKTagManager.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I just don't understand why it can not find the TAGManager calls any more. I'm using Xcode 6.2 and the the RKTagManager is ment for iOS.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • Hi, Can you please provide details for the xCode version and the supported architecture. Thanks – Ganesh Somani Mar 23 '15 at 08:00
  • I've added to the information. – rckoenes Mar 23 '15 at 10:09
  • I think the issue is that `GoogleAnalytics-iOS-SDK` spec links to google url but the old "library" is not present there anymore. There you can only find the new framework they are using. – Moxy Mar 23 '15 at 21:04
  • I believe you have added a framework with only supports iOS 8 and above but you application deployment target is 5.1.1. Hence you have the issue. Also with 6.2 64 bit arch is compulsory. Please check for that too. – Ganesh Somani Mar 24 '15 at 01:36
  • No the GooleAnalytics pod has support for iOS 5.1.1 and 64Bit is default. This is not the issue. – rckoenes Mar 24 '15 at 08:10

1 Answers1

3

The solution seem to be to force CocoaPods to build the pod spec with as a library. Since 0.36 the pods are build a framework and no loner as framework.

Use the --use-libraries to compile to pod spec as a library instant of a framework.

You can do this like:

pod repo push OIPods RKTagManager.podspec.json --use-libraries
rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • Great solution got found an issue where my pod failed for - ERROR | [MKDKit/MKDUIKit,MKDKit/MKDAnalytics] Returned an unsuccessful exit code. - NOTE | [MKDKit/MKDUIKit,MKDKit/MKDAnalytics] clang: error: linker command failed with exit code 1 (use -v to see invocation) – StackRunner Apr 09 '15 at 15:58