I recently switched my development MacBook from a classic MacBook (32 bit) to a MacBook Air (64 bit). I am trying to open a project that was made on my old MacBook (32 bit) running XCode 4.
我最近把我的开发笔记本电脑从经典的MacBook(32位)换成了MacBook Air(64位)。我正在尝试打开一个在我的旧MacBook(32位)运行XCode 4的项目。
The project is a PhoneGap application made in PhoneGap 1.7.0.
这个项目是一个PhoneGap应用程序,在PhoneGap 1.7.0中。
My new MacBook Air (64 bit) is running XCode 5.
我的新MacBook Air(64位)正在运行XCode 5。
I imported my developer profiles from my old MacBook to my new MacBook Air. But when I try to run it, I get the following error message.
我从我的旧MacBook上导入了我的开发人员配置文件到我的新MacBook Air上。但是当我尝试运行它时,我得到了以下错误消息。
I have tried changing the my architecture in the build settings to armv7 but still no luck :(
我尝试将我的架构更改为armv7,但仍然没有成功:(
Does anyone know why I'm getting this error and how to fix it?
有人知道我为什么会犯这个错误吗?
Thanks
谢谢
2 个解决方案
#1
26
OK so as it turns out, XCode 5 changes the default architecture to armv7 when my application does not support armv7. I am running Cordova 1.7.0 and that version does not have support for armv7 architecture.
因此,当我的应用程序不支持armv7时,XCode 5将默认的架构更改为armv7。我正在运行Cordova 1.7.0,这个版本不支持armv7架构。
Fix architecture issue:
- Removed ALL architectures from
Build Settings
-->Valid Architecture
- 从构建设置移除所有的架构——>有效架构。
- Added
armv6
toBuild Settings
-->Valid Architecture
- 增加armv6构建设置——>有效架构。
Fix libSystem.B.dylib
issue:
-
Removed
/usr/lib/libSystem.B.dylib
fromBuild Settings
-->Linking
-->Other Linker Flags
/usr/lib/libSystem.B删除。dylib从构建设置——>链接——>其他链接标记。
-
Also removed
-weak_library
fromBuild Settings
-->Linking
-->Other Linker Flags
还从构建设置中移除-weak_library——>链接——>其他链接标记。
#2
1
Xcode 5 asks you to build your libraries for the simulator (1) and for iOS (2). You can then merge (3) these into a fat binary which you then link to your main project. I use the same flags as Xcode is using to build your main project (as seen in your screendump).
Xcode 5要求您为模拟器(1)和iOS(2)构建您的库,然后将这些库合并成一个fat二进制文件,然后将其链接到您的主项目。我使用与Xcode相同的标志来构建您的主项目(正如您在屏幕上看到的那样)。
Expressed in common gnu toolchain variables I do:
在通用gnu工具链变量中表示:
1. Building a library for the simulator
1。为模拟器构建一个库。
CC=clang
IPHONEOS_DEPLOYMENT_TARGET=7.0
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH"
CFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -mios-simulator-version-min=7.0"
2. Building a library for iOS
2。为iOS构建一个库。
CC=clang
IPHONEOS_DEPLOYMENT_TARGET=7.0
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH"
CFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0"
3. Merging to a fat binary
3所示。合并到一个fat二进制文件。
Choose either of .a
or .dylib
depending on what you use:
根据您使用的内容选择a或.dylib:
lipo -create "your armv7 lib".a "your simulator lib".a -output "your lib".a
lipo -create "your armv7 lib".dylib "your simulator lib".dylib -output "your lib".dylib
#1
26
OK so as it turns out, XCode 5 changes the default architecture to armv7 when my application does not support armv7. I am running Cordova 1.7.0 and that version does not have support for armv7 architecture.
因此,当我的应用程序不支持armv7时,XCode 5将默认的架构更改为armv7。我正在运行Cordova 1.7.0,这个版本不支持armv7架构。
Fix architecture issue:
- Removed ALL architectures from
Build Settings
-->Valid Architecture
- 从构建设置移除所有的架构——>有效架构。
- Added
armv6
toBuild Settings
-->Valid Architecture
- 增加armv6构建设置——>有效架构。
Fix libSystem.B.dylib
issue:
-
Removed
/usr/lib/libSystem.B.dylib
fromBuild Settings
-->Linking
-->Other Linker Flags
/usr/lib/libSystem.B删除。dylib从构建设置——>链接——>其他链接标记。
-
Also removed
-weak_library
fromBuild Settings
-->Linking
-->Other Linker Flags
还从构建设置中移除-weak_library——>链接——>其他链接标记。
#2
1
Xcode 5 asks you to build your libraries for the simulator (1) and for iOS (2). You can then merge (3) these into a fat binary which you then link to your main project. I use the same flags as Xcode is using to build your main project (as seen in your screendump).
Xcode 5要求您为模拟器(1)和iOS(2)构建您的库,然后将这些库合并成一个fat二进制文件,然后将其链接到您的主项目。我使用与Xcode相同的标志来构建您的主项目(正如您在屏幕上看到的那样)。
Expressed in common gnu toolchain variables I do:
在通用gnu工具链变量中表示:
1. Building a library for the simulator
1。为模拟器构建一个库。
CC=clang
IPHONEOS_DEPLOYMENT_TARGET=7.0
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH"
CFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -mios-simulator-version-min=7.0"
2. Building a library for iOS
2。为iOS构建一个库。
CC=clang
IPHONEOS_DEPLOYMENT_TARGET=7.0
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH"
CFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0"
3. Merging to a fat binary
3所示。合并到一个fat二进制文件。
Choose either of .a
or .dylib
depending on what you use:
根据您使用的内容选择a或.dylib:
lipo -create "your armv7 lib".a "your simulator lib".a -output "your lib".a
lipo -create "your armv7 lib".dylib "your simulator lib".dylib -output "your lib".dylib