Xcode 10 二进制架构无效?
Xcode 10 Invalid binary architecture?
我有一个 iOS 应用程序支持 iOS 11/12。我一直在使用 Xcode 10 向 App Store Connect for TestFlight 提交构建,没有问题。今天我使用 Xcode 10 提交了一个构建,我收到了以下电子邮件:
Dear Developer,We identified one or more issues with a recent delivery
for your app, "DevelopAP". Please correct the following issues, then
upload again. Invalid Binary Architecture - iOS 3.0 introduced support
for multiple binary architectures. If your binary is built for
multiple architectures, your Info.plist must have a MinimumOSVersion
key with a value of at least 3.0. Additionally, if your app is
intended to support earlier iPhone and iPod touch models, your app
must contain at least an armv6 binary; "thin" armv7-only binaries will
not be accepted unless the armv7 required device capability is also
present in the Info.plist UIRequiredDeviceCapabilities key or the
MinimumOSVersion key has a value of 4.3 or higher. Specifically, we
found the following unsupported architectures in your binary:
x86_64。
部署目标 - 10.0
Swift 语言版本 - 3.3
Pods 部署目标版本 - 10.0
我尝试在 info.plist 中使用 armv6。并尝试在 Xcode 9.4.1 中构建。并尝试使用启动脚本,但这个问题仍然存在于这个项目中。
如果有人有任何想法,将不胜感激。
将此 运行 脚本添加到您的项目中
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
他们找到了架构 "x86_64"。那是 64 位 Intel 处理器。你能告诉我 any iPhone 使用 Intel 处理器吗?它们不存在。因此,找出 64 位 Intel 代码潜入您的项目的位置并将其删除。
尝试添加 armv6 是严重的误导。 armv6 可以在 iPhone 3GS 上找到。您的应用程序应该支持 aarch64 或 arm64(这是必需的),如果您有兴趣支持 32 位设备,则支持 armv7,那将是 iPhone 5/5c 或更早版本。
我有一个 iOS 应用程序支持 iOS 11/12。我一直在使用 Xcode 10 向 App Store Connect for TestFlight 提交构建,没有问题。今天我使用 Xcode 10 提交了一个构建,我收到了以下电子邮件:
Dear Developer,We identified one or more issues with a recent delivery for your app, "DevelopAP". Please correct the following issues, then upload again. Invalid Binary Architecture - iOS 3.0 introduced support for multiple binary architectures. If your binary is built for multiple architectures, your Info.plist must have a MinimumOSVersion key with a value of at least 3.0. Additionally, if your app is intended to support earlier iPhone and iPod touch models, your app must contain at least an armv6 binary; "thin" armv7-only binaries will not be accepted unless the armv7 required device capability is also present in the Info.plist UIRequiredDeviceCapabilities key or the MinimumOSVersion key has a value of 4.3 or higher. Specifically, we found the following unsupported architectures in your binary:
x86_64。 部署目标 - 10.0 Swift 语言版本 - 3.3 Pods 部署目标版本 - 10.0
我尝试在 info.plist 中使用 armv6。并尝试在 Xcode 9.4.1 中构建。并尝试使用启动脚本,但这个问题仍然存在于这个项目中。
如果有人有任何想法,将不胜感激。
将此 运行 脚本添加到您的项目中
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
他们找到了架构 "x86_64"。那是 64 位 Intel 处理器。你能告诉我 any iPhone 使用 Intel 处理器吗?它们不存在。因此,找出 64 位 Intel 代码潜入您的项目的位置并将其删除。
尝试添加 armv6 是严重的误导。 armv6 可以在 iPhone 3GS 上找到。您的应用程序应该支持 aarch64 或 arm64(这是必需的),如果您有兴趣支持 32 位设备,则支持 armv7,那将是 iPhone 5/5c 或更早版本。