当我打开在Xcode 4中创建的Google Maps项目时,Xcode 5会警告有关我的体系结构设置的信息 [英] Xcode 5 warns about my architectures setting when I open my Google Maps project created in Xcode 4

查看:91
本文介绍了当我打开在Xcode 4中创建的Google Maps项目时,Xcode 5会警告有关我的体系结构设置的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚更新到新发布的Xcode5.我正在开发一个使用Google Maps iOS SDK的iOS应用.回到使用Xcode 4进行开发时,我按照Google Architectures设置. rel ="nofollow">将SDK添加到项目的说明:

I just updated to the newly released Xcode 5. I have an iOS app under development that uses the Google Maps iOS SDK. Back when I was developing in Xcode 4, I changed my Architectures setting in my project settings, as per step 7 of Google's instructions for adding the SDK to the project:

7.选择您的项目而不是特定的目标,然后打开构建设置"选项卡. 用armv7替换默认的Architectures值. 在其他链接器标志"部分中,添加-ObjC.如果看不到这些设置,请将构建设置"栏中的过滤器从基本"更改为全部".

7. Choose your project, rather than a specific target, and open the Build Settings tab. Replace the default value of Architectures with armv7. In the Other Linker Flags section, add -ObjC. If these settings are not visible, change the filter in the Build Settings bar from Basic to All.

在Xcode 4中一切都很好.但是,当我在Xcode 5中打开项目时,在问题导航器中看到以下警告:

Everything was fine in Xcode 4. However, when I open my project in Xcode 5, I see the following warning in the issue navigator:

验证项目设置

Validate Project Settings

更新为推荐设置

当我单击警告时,Xcode会将我带到我的项目设置,并显示一个带有取消"和执行更改"按钮的弹出窗口,以及它要进行的更改的以下说明

When I click the warning, Xcode takes me to my project settings and displays a popup with 'Cancel' and 'Perform Changes' buttons, and the following description of the change it wants to make

项目您的项目"-自动选择架构

项目您的项目"会覆盖体系结构"设置.这将删除设置,并允许Xcode根据可用于活动平台和部署目标的硬件自动选择体系结构.

Project 'Your Project' overrides the Architectures setting. This will remove the settings and allow Xcode to automatically select Architectures based on hardware available for the active platform and deployment target.

我尝试单击执行更改",然后让Xcode做它想做的事情,并且该应用程序仍然可以很好地用于模拟器.但是,当我尝试插入支持ARMv7S的iPhone 5并在其上运行时,该应用程序无法构建,并出现以下链接器错误:

I tried clicking 'Perform Changes' and letting Xcode do whatever it wanted to do, and the app still built fine for the simulators. However, when I tried plugging in an iPhone 5 (which supports ARMv7S) and running on it, the app failed to build with the following linker error:

Ld /Users/macmini/Library/Developer/Xcode/DerivedData/Your_App-bmrouudjlblpafdjzhpwcuekzgwu/Build/Products/Debug-iphoneos/Your\ App.app/Your\ App normal armv7s
    cd "/Users/macmini/Documents/Your App"
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
    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"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/macmini/Library/Developer/Xcode/DerivedData/Your_App-bmrouudjlblpafdjzhpwcuekzgwu/Build/Products/Debug-iphoneos -F/Users/macmini/Library/Developer/Xcode/DerivedData/Your_App-bmrouudjlblpafdjzhpwcuekzgwu/Build/Products/Debug-iphoneos -F/Users/macmini/Documents/Your\ App -filelist /Users/macmini/Library/Developer/Xcode/DerivedData/Your_App-bmrouudjlblpafdjzhpwcuekzgwu/Build/Intermediates/Your\ App.build/Debug-iphoneos/Your\ App.build/Objects-normal/armv7s/Your\ App.LinkFileList -dead_strip -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.1 -framework SystemConfiguration -framework MapKit -framework QuartzCore -framework OpenGLES -lz -licucore -lc++ -framework ImageIO -framework GLKit -framework CoreText -framework CoreLocation -framework AVFoundation -framework CoreData -framework UIKit -framework Foundation -framework CoreGraphics -framework GoogleMaps -Xlinker -dependency_info -Xlinker /Users/macmini/Library/Developer/Xcode/DerivedData/Your_App-bmrouudjlblpafdjzhpwcuekzgwu/Build/Intermediates/Your\ App.build/Debug-iphoneos/Your\ App.build/Objects-normal/armv7s/Your\ App_dependency_info.dat -o /Users/macmini/Library/Developer/Xcode/DerivedData/Your_App-bmrouudjlblpafdjzhpwcuekzgwu/Build/Products/Debug-iphoneos/Your\ App.app/Your\ App

ld: file is universal (2 slices) but does not contain a(n) armv7s slice: /Users/macmini/Documents/Your App/GoogleMaps.framework/GoogleMaps file '/Users/macmini/Documents/Your App/GoogleMaps.framework/GoogleMaps' for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

一旦我恢复了Xcode所做的自动更改,我的应用就可以再次为iPhone 5正常编译-但我当然也收到了警告.

Once I reverted the automatic changes Xcode had made, my app compiled fine for iPhone 5 again - but of course I had the warning back.

我如何满足Xcode并摆脱警告,同时仍允许我的应用程序成功为iPhone 5生成?

How can I satisfy Xcode and get rid of the warning while still allowing my app to build successfully for iPhone 5?

推荐答案

糟糕-发生这种情况后,我在发布此问题以自行找到答案后只花了几秒钟的实验时间:

Oops - as it happened it only took me a few seconds of experimentation after posting this question to find the answer myself:

  1. 在问题导航器中单击验证项目设置"警告.
  2. 取消选中自动选择体系结构"建议的更改左侧的复选框.
  3. 单击完成"(如果您实际上要在列表上进行其他更改,则单击执行更改"-在我的情况下,这是唯一的更改).

现在您的设置与以前一样,可以为iPhone 5进行构建,但是警告消失了.

Now your settings are as they were before, and you can build for iPhone 5, but the warning is gone.

现在我花了很多时间发布这个问题,我感到有些沮丧,但是我将问题和这个答案留在这里,以防将来对任何人有帮助.

I feel a bit dim now for having spent my time posting this question, but I'm leaving the question and this answer here in case it helps anyone in the future.

这篇关于当我打开在Xcode 4中创建的Google Maps项目时,Xcode 5会警告有关我的体系结构设置的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆