我有一个使用可可豆荚安装Google AdMob SDK的iOS项目。当我启动项目时,项目的名称称为MAPPER。然后我在Xcode中将项目重命名为GLITTER。除了可可豆荚之外,Xcode几乎在所有地方都更改了名称。我必须手动重命名,如
target 'Glitters' do
pod 'Google-Mobile-Ads-SDK', '~> 7.0'
end
target 'GlittersTests' do
end
我必须手动重命名它。然后POD INSTALL工作正常。但是我的编译失败了链接器错误,如下所示
ld: library not found for -lPods-Mapper
clang: error: linker command failed with exit code 1 (use -v to see invocation)
完整日志消息
Ld /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator/Glitters.app/Glitters normal x86_64
cd /Users/BharathMBA/iOS/Swift/Mapper
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator -F/Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator -F/Users/BharathMBA/iOS/Swift/Mapper/Pods/Google-Mobile-Ads-SDK/GoogleMobileAdsSdkiOS-7.0.0 -filelist /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-Glitters-Google-Mobile-Ads-SDK -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreTelephony -framework EventKit -framework EventKitUI -framework GoogleMobileAds -framework MessageUI -framework StoreKit -framework SystemConfiguration -weak_framework AdSupport -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -force_load -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a -Xlinker -add_ast_path -Xlinker /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters.swiftmodule -mios-simulator-version-min=7.0 -lPods-Mapper -lPods-Glitters -Xlinker -dependency_info -Xlinker /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters_dependency_info.dat -o /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator/Glitters.app/Glitters
在日志中,我可以看到-Pods-Mapper被调用进行链接
-Xlinker -add_ast_path -Xlinker /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters.swiftmodule -mios-simulator-version-min=7.0 -lPods-Mapper -lPods-Glitters -Xlinker -dependency_info
我不知道如何摆脱这个问题。
由于
答案 0 :(得分:8)
转到目标的General
标签,然后滚动到名为Linked Frameworks and Libraries
的部分。
在这里,您应该看到2个对您的Pod的引用'框架:
Pods_<previous-target-name>.framework
Pods_<current-target-name>.framework
删除对广告Pods_<previous-target-name>.framework
的引用。
答案 1 :(得分:0)
我遇到了同样的问题,发现xcode没有改变某些路径。我最终做了以下事情:
target
build phases
标签[CP] Embed Pods Frameworks
和[CP] Copy Pods Frameworks
阶段但是,这只会给我带来更多错误。我这次选择了项目,并扩展了Configurations
部分。在这里,我看到使用了很多旧的引用。我没有手动更改它们,而是决定使用pod deintegrate
和pod install
再次解体并再次安装pod,然后解决问题。
我认为在解体时,第一步是不必要的,但我认为知道它们存在是很好的。