公司最近的一次App提交过程中遇到的一些问题,现贴在这里,有检索到本篇的朋友们可借鉴。
首先是上传到iTunes Connect构建版本,点击以下蓝色按钮,之后会有苹果为你的代码进行检查:
本人在ios11上做了提交,发现问题进行分类:
- 第一个是第三方库存在x86_64,i386的链接库,有以下问题:
1 | iTunes Store Operation Failed |
PS:以下所有翻译来源于欧路词典,粘贴过来的,仅供参考;1
2
3iTunes Store Operation Failed
ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'LeWaiJiao.app/Frameworks/GCDWebServers.framework/GCDWebServers' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
无效段对齐。应用程序二进制的“lewaijiao。应用程序/框架/ gcdwebservers。框架/ gcdwebservers”没有正确对齐。尝试用新的Xcode版本重建应用程序。
1 | iTunes Store Operation Failed |
1 | iTunes Store Operation Failed |
1 | ERROR ITMS-90362: "Invalid Info.plist value. The value for the key 'MinimumOSVersion' in bundle ***.app/Frameworks/SDK.framework is invalid. The minimum value is 8.0" |
后面这个90362貌似是连带问题,定位的时候发现与最小版本无关,所以一同被解决了;
解决方法呢是在该工程里添加脚本处理这些被添加进来的第三方库,如下:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27APP_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
以上代码来源于Google,解决方法经确认iOS11 + Xcode9.0有效;
- 项目有icon不合规定的错误
1
2
3iTunes Store Operation Failed
ERROR ITMS-90717: "Invalid App Store Icon. The App Store Icon in the asset catalog in 'LeWaiJiao.app' can't be transparent nor contain an alpha channel."
无效应用程序商店图标。在资产目录中的lewaijiao App Store图标,应用程序不能透明也包含alpha通道。”
该错误原因是上传的icon不符合苹果规定,公司项目存在的问题是1.使用了圆角;2.有透明alpha通道;
解决方法自然容易了,找设计重新做,自己解决的话第二个可以DIY,如下:
用系统预览打开icon图片,点掉Alpha的勾,再保存就可以了;
- 提交上传结束后又出现了一个问题
1 | App Installation failed, No code signature found. |
真机无法运行了!这个问题纯属偶然,所以继续解决;打开终端,输入
1 | sudo chmod -R 777 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk |
修改文件权限,然后修改字段属性,打开:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist
,修改 CODE_SIGNING_REQUIRED 字段为 YES ,保存;