kstenerud / iOS-Universal-Framework

An XCode project template to build universal frameworks (arm7, arm7s, and simulator) for iOS / iPhone.
2.95k stars 473 forks source link

Doesn't compile for armv6 in Xcode 4.2 #27

Closed smeador closed 12 years ago

smeador commented 12 years ago

Xcode 4.2 changes the definition of ARCHS_STANDARD_32_BIT to be just armv7. I tried settings the ARCHS variable explicitly to "armv6 arvm7", but this causes the shell script to crash while building the other platforms.

I'd still like to support older devices, so a fix would be much appreciated.

kstenerud commented 12 years ago

Try this:

First set "Architectures" back to the default $(ARCHS_STANDARD_32_BIT) Under "Architectures", select "other". It should show $(ARCHS_STANDARD_32_BIT) in a list view. Click the + button and add "armv6".

I just tried this approach on a fresh fake framework project and it seems to be working (builds without error, lipo --info tells me it has armv6, armv7, i386). Let me know if this helps.

rbsgn commented 12 years ago

Please note that iOS Simulator is now x86_64 on OS X Lion. So you need to build x86_64 too.

smeador commented 12 years ago

That works. I tested on my real framework too. It seems that when I added "armv7 armv6" explicitly, Xcode was not building for i386 and this was causing a crash when building for the simulator.

@kstenerud thanks for the fix and @nskboy thanks for the tip.

cgriffin commented 12 years ago

I'm having the same issue. I can compile the framework fine when it's not a dependency of my main project. When I add it to my main project I get this:

=== BUILD NATIVE TARGET SQLiteMath OF PROJECT SQLiteMath WITH CONFIGURATION Debug === Check dependencies [BEROR]No architectures to compile for (ARCHS=armv6 armv7, VALID_ARCHS=i386). \ BUILD FAILED ** The following build commands failed: Check dependencies (1 failure)

I tried the suggestion from above but that didn't help.

cgriffin commented 12 years ago

It looks like the framework is built correctly. All the parts are there and the binary has both armv6 and armv7. It also compiles without error for the simulator. Just gets that error when compiling for device.

zhouhuishine commented 12 years ago

I changed the script, and it ran perfact:

echo "Build other platform"

if [[ "$UFW_OTHER_PLATFORM" = "iphonesimulator" ]] then echo xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" ARCHS=i386 -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" CONFIGURATION_TEMP_DIR="${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}" $ACTION xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" ARCHS=i386 -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" CONFIGURATION_TEMP_DIR="${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}" $ACTION else echo xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" ARCHS=$(VALID_ARCHS) -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" CONFIGURATION_TEMP_DIR="${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}" $ACTION xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" ARCHS=$(VALID_ARCHS) -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" CONFIGURATION_TEMP_DIR="${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}" $ACTION fi