2014-04-15 15 views
9

Ho una libreria statica iOS che non sta costruendo. Usa i cocoapodi per gestire un numero di dipendenze oltre ad essere un pod stesso.Cocoapods - impossibile trovare il file per: -lPods/-lPods non è un file oggetto (non consentito in una libreria)

Ciò che è interessante è che quando la libreria viene utilizzata in un progetto client come un pod, tutto si compila bene.

Ecco l'output del mio errore:

Libtool /Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Intermediates/MyLibrary.build/Debug-iphoneos/MyLibrary.build/Objects-normal/armv7/libMyLibrary.a normal armv7 
    cd /Users/Bob/Projects/MyLibrary 
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0 
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only armv7 -syslibroot /Users/Bob/Projects/Xcode\ SDKs/iPhoneOS6.1.sdk -L/Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Products/Debug-iphoneos -filelist /Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Intermediates/MyLibrary.build/Debug-iphoneos/MyLibrary.build/Objects-normal/armv7/MyLibrary.LinkFileList -ObjC -framework SystemConfiguration -framework Security -framework CoreGraphics -framework CoreText -framework CoreLocation -framework UIKit -framework QuartzCore -framework Foundation -lPods -o /Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Intermediates/MyLibrary.build/Debug-iphoneos/MyLibrary.build/Objects-normal/armv7/libMyLibrary.a 

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods is not an object file (not allowed in a library) 
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1 

Cosa posso fare/che cosa altre informazioni è necessario fornire?

risposta

18

Il mio problema è che sono andato da utilizzando una podfile del formato

platform :ios, '6.0' 
pod 'AFNetworking' 

a

platform :ios, '6.0' 
target 'myproject' do 
    pod 'AFNetworking' 
end 

che ha cambiato libPods.a ad lib-myproject.a. Il file di progetto stava ancora tentando di collegare libPoda.a, che non esisteva più e ha provocato l'errore. Elimina libPods.a dal link con la sezione framework delle fasi di compilazione.

+0

Penso che intendessi dire che ora è 'libPods-mytarget.a' ... assumendo che tu abbia 'target' mytarget 'do' nel tuo Podfile (con' target 'myproject'' maschererebbe la distinzione tra i progetti xcode e obiettivi). – tboyce12

Problemi correlati