解决xcode和App Store报错
参考资料:
- Xcode 10 beta3 Error: Multiple commands produce
- [App Store提交审核报错 ERROR ITMS-90087解决办法](App Store提交审核报错 ERROR ITMS-90087解决办法)
- ERROR ITMS-90206:“Invalid Bundle. The bundle at ‘XXX.appex’ contains disallowed file ‘Frameworks’.”
- CFBundleVersion Mismatch - The CFBundleVersion value does not match the CFBundleVersion value of its containing iOS application
Xcode 10 Error: Multiple commands produce
使用xcode10编译项目报错
error: Multiple commands produce '/Users/xiaoyuan/Library/Developer/Xcode/DerivedData/Boobuz-gnxeuntgkenwgdgycqnvabqubafh/Build/Products/Debug-iphoneos/Boobuz.app':
1) Target 'Boobuz' has create directory command with output '/Users/xiaoyuan/Library/Developer/Xcode/DerivedData/Boobuz-gnxeuntgkenwgdgycqnvabqubafh/Build/Products/Debug-iphoneos/Boobuz.app'
2) That command depends on command in Target 'Boobuz': script phase “[CP] Copy Pods Resources”
原因是Xcode 10 默认使用的build system是New build system,与Xcode9不同导致。
解决方法:修改build system
在Xcode菜单栏 -> File -> Workspace Setting,将build system修改为legacy build system,然后clean后编译。
App Store提交审核报错 ERROR ITMS-90087
报错信息
ERROR ITMS-90087: "Unsupported Architectures. The executable for yht.temp_caseinsensitive_rename.app/Frameworks/VideoCore.framework contains unsupported architectures '[x86_64, i386]'."
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'yht.temp_caseinsensitive_rename.app/Frameworks/VideoCore.framework/VideoCore' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."
WARNING ITMS-90080: "The executable 'Payload/yht.temp_caseinsensitive_rename.app/Frameworks/VideoCore.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library."
AppStore不允许SDK里面包含了x86_64, i386 架构的,所有会在上传的时候报错,解决办法就是要这个SDK剔除掉x86_64, i386这两个架构
解决办法: TARGETS->Build Phases->点击加号选择New Run Script Phase->然后复制粘贴下面代码
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
ERROR ITMS-90206:“Invalid Bundle. The bundle at ‘XXX.appex’ contains disallowed file ‘Frameworks’.”
当我们上传我们的包到AppStore的时,有时候会报出错误:ERROR ITMS-90206:"Invalid Bundle. The bundle at 'XXX.appex' contains disallowed file 'Frameworks'."
发生错误的原因:我们使用了ios的extension扩展插件,比如today-widget,或者是AppWatch等。
首先进入项目Build Setting
-
For main project: Embedded Content Contains
Swift Code to Yes -
Custom Framework: Embedded Content Contains Swift Code to No
-
Custom Framework: Runpath Search Path = @executable_path/…/…/Frameworks
尝试是否OK,一般情况下会OK的,如果还不行的话,继续下面的操作
进入到扩展插件下->Build Phases 点击添加按钮,选择New Run Script Phase,然后将加入下面代码:
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
上面的脚本会把扩展插件依赖的framework给删除。
可以尝试修改扩展插件对framework的文件的依赖,将framework的文件抽取出来,就想平常的文件那样引用。
CFBundleVersion Mismatch
原因是today extension的应用和主APP的版本和构建版本不一致,两者维护成一致的就没有这个问题了。