gpt4 book ai didi

ios - Admob 框架未找到 GoogleMobileAds 链接器错误

转载 作者:行者123 更新时间:2023-11-29 01:27:47 24 4
gpt4 key购买 nike

我正在尝试在我的应用程序中实现 admob,以便它可以在 iAd 不能或不会展示广告时展示广告。我遇到了这个错误,我已经尝试了所有可以在网上找到的方法来修复它。似乎没有任何效果。

未找到框架 GoogleMobileAdsclang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

为了实现 admob,我下载了最新的 GoogleMobileAdsSDK 并将其解压缩。然后我去了 Linked Frameworks and Libraries 并将其添加到那里。我必须浏览我解压缩它的位置才能得到它。我还在网上看到一些关于将 -ObjC 添加到 Linking > Other Linker Flags 的内容,我做到了。当我构建它时,我得到了错误。如果我将它从 Linked Frameworks and Libraries 中删除,我的应用程序将再次编译。

这是完整的链接器错误:

Ld/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator/SampleProject.app/SampleProject 正常 x86_64 cd "/Users/Scott/Documents/Production Code/iOS7/Production/SampleProject" 导出 IPHONEOS_DEPLOYMENT_TARGET=9.0 export PATH="/Applications/Xcode 7/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode 7/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode\7/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot/Applications/Xcode\7/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator。平台/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator -F/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator -F/Users/Scott/Documents/Production\Code/iOS7/Production/SampleProject -文件列表/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqk dlsewsiu/构建/中间体/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.0 -Xlinker -objc_abi_version - Xlinker 2 -ObjC -L/Applications/Xcode\7/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject.swiftmodule -framework GoogleMobileAds -framework iAd -Xlinker -dependency_info -Xlinker/Users/Scott/图书馆/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject_dependency_info.dat -o/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator/SampleProject.app/SampleProject

对此有什么想法吗?

最佳答案

我能够用下面的代码解决同样的问题。

从项目中删除 GoogleMobileAds 框架。并再次添加

将其添加到build设置中的库搜索路径,并确保选择递归,删除其他可能是绝对路径的库路径。

$(PROJECT_DIR) 

也许它会对你有所帮助。

关于ios - Admob 框架未找到 GoogleMobileAds 链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33818396/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com