我正在开发一个使用谷歌地图的应用程序。我会解释我对谷歌地图所做的工作,也许你可以帮助我。
我使用的是Google地图框架,没有POD,但是在Google map key我删除了谷歌地图框架引用,并使用POD安装了它。一切工作正常,但当我点击
产品 - >测试
现在我得到这个错误:
ld:未找到框架GoogleMaps for architecture arm64 $ b $谢谢!
Podfile看起来像这个Cocoapods v1.0 beta 6):
platform:ios,'8.0' use_frameworks! target'Project'做 pod'GoogleMaps' target'ProjectTests'do 继承! :search_paths pod'Mockingjay' end end解决方案
更新请检查架构和构建活动中是否具有相同的构建设置只有体系结构目标键
您的podfile应该像这样
platform:ios,'8.0' use_frameworks! target'Project'do pod'GoogleMaps' end target'ProjectTests'do // //继承! :search_paths pod'Mockingjay' end结束项目目标,然后再启动 ProjectTest 目标,同时为什么要添加继承! :search_paths ?它通常不需要,除非你有特殊要求
旧回答
如果你想要你在测试目标中的豆荚比你必须添加,然后在测试中也是以相同的方式添加到项目的主要目标中
所以你的如果SwiftCocoaPods是您的主要目标名称,则为可可豆荚 //其他顶级进口 targetSwiftCocoaPods do b $ b podGoogleMaps end targetSwiftCocoaPodsTestsdo podGoogleMaps end然后,您应该为SwiftCocoaPodsTests添加测试用的Pod。您可以用您测试目标名称为
来替换名称否则,如果您想在多个目标中添加相同的窗格,可以使用 def 并在所有目标中使用它
def project_pods pod GoogleMaps //在所有目标中添加所需的其他窗格结束 目标SwiftCocoaPodsdo project_pods 结束 //仅添加project_pods而不是单独的pod targetSwiftCocoaPodsTestsdo project_pods end
I'm developing an app using google maps. I will explain what I did with google maps, and maybe you can help me.
I was using Google maps frameworks without POD, but after a few errors about Google map Key I deleted the google map frameworks reference and I installed it using POD. Everything is working fine, but when I hit
Product -> TEST
now I get this error:
ld: framework not found GoogleMaps for architecture arm64Any idea how fix this?
Thank you!
Podfile looks like this Cocoapods v1.0 beta 6):
platform :ios, '8.0' use_frameworks! target 'Project' do pod 'GoogleMaps' target 'ProjectTests' do inherit! :search_paths pod 'Mockingjay' end end解决方案
Update Please check if you have same build settings in the Architectures and Build active Architectures only keys of the targets
Your podfile should look like this
platform :ios, '8.0' use_frameworks! target 'Project' do pod 'GoogleMaps' end target 'ProjectTests' do //inherit! :search_paths pod 'Mockingjay' endEnd the project target before you start the ProjectTest target, also why you add inherit! :search_paths? it's usually not needed unless you have some special requirement
Old Answer
If you want to you pods in the Test target than you have to add then in the test also the same way you have added in project's main target
So your cocoa pods like this if "SwiftCocoaPods" is your main target name
//other top level imports target "SwiftCocoaPods" do pod "GoogleMaps" end target "SwiftCocoaPodsTests" do pod "GoogleMaps" endThen you should add pods for the test also like "SwiftCocoaPodsTests". you may replace the name with whatever you Test target name is
Else if you want to add the same pods in the multiple target you can use def and use that in all the targets which looks like this
def project_pods pod "GoogleMaps" //add other pods which you want in all the targets end target "SwiftCocoaPods" do project_pods end //only add project_pods instead of pods individually target "SwiftCocoaPodsTests" do project_pods end
更多推荐
iOS,ld:框架未找到适用于架构arm64的GoogleMaps
发布评论