最近帮部门内部其他小组利用RN写app,但是对于移动开发的中的,ios和 android工程上的问题,
没有移动开发经验还是不行的,所以,工程相关的坑,就让我来趟了。

打包上传,本以为没什么问题,结果出了几个错误

itms错误

itsm-90087

提示自建的framework包包含了不支持的架构 x86_64,之前用存静态库(.a)是没有这个问题,
查阅相关资料得知,自建framework在打正式包的时候,需要自己做 thin 处理,

1
2
3
lipo Stickies.app/Contents/MacOS/Stickies -thin i386
-output Stickies.app/Contents/MacOS/Stickies.i386

例如上段命令,可以从 fat 过的包中,提取出某个架构的包。

Daniel Kennett
给出了他的方案,在 Build Phases -> Embed Frameworks 之后加一个 Run Script 即可

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
27
28
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

作用是根据工程声明,做thin处理,替换framework

itsm-90362

这个itsm提示另一个的framework的info.plist有问题,提示版本号问题,查看一下
最小版本是7.0,没有问题啊,实在搞不清楚为什么提示我8.0,我的app版本是8.0
framework版本是7.0 没有任何问题啊,

原来是自建framework最小要求ios8.0的原因,把该framework改成8.0,问题解除

access privacy-sensitive

终于通过提交,结果收到苹果一封信

This app attempts to access privacy-sensitive data without a usage description.
The app’s Info.plist must contain an NSCameraUsageDescription key with a string
value explaining to the user how the app uses this data.

感情是我用到了相机,但是没有申请访问该权限的说明,好吧,在info.plist 里面加上

1
2
<key>NSCameraUsageDescription</key>
<string>支付安全考虑</string>

本文地址: http://adanchou.me/2016/09/29/ios-itms-90362-90087/