最近苹果推出新的mac操作系统(macOS Sierra 10.12),大家可能都已经升级了,作为一个开发者,小编肯定是第一时间升级。随之,开发工具 Xcode 也升级到了最新版 Xcode 8.0。
马上就到国庆了,想必很多人和小编一样在加班赶进度,上架项目。当我们把一切BUG解决完(当然这是不可能的),提交成功之后,欣喜的去 iTunes Connect 上发布版本时。
咦...哇...怎么回事?构建版本旁边没有出现我们预期的 “加号” 按钮,这让我们如何发布新版本。
网上搜了搜,很模糊,都指的是 iOS 10 权限问题,可是到底是什么权限问题,该怎么解决。这里小编就告诉大家:
1、如何解决iOS10权限设置问题
2、如何避免这样类似的问题
一:iOS 10 权限设置问题:
iOS 10的一大变化是更强的隐私数据保护。如果你不设置相应的权限就会crash(比如:大家最近遇到的选择相册、相机 crash问题)。解决办法是在 info.plist 文件中添加对应的Key-Value权限就可以了。
添加权限有两种方式:
方式一:
1、在工程找到 info.plist 文件:Supporting Files -> info.plist -> 右击 -> Open As -> Source Code ,打开plist文件。
2、根据项目权限需求,复制 以下 相应 Value 和 Key 到 plist文件中。
访问蓝牙:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>访问蓝牙</string>
访问相机:
<key>NSCameraUsageDescription</key>
<string>访问相机</string>
使用期间访问位置:
<key>NSLocationWhenInUseUsageDescription</key>
<true/>
访问麦克风:
<key>NSMicrophoneUsageDescription<key/>
<string>访问麦克风</string>
访问相册:
<key>NSPhotoLibraryUsageDescription</key>
<string>访问相册</string>
始终访问位置:
<key>NSLocationAlwaysUsageDescription</key>
<true/>
访问通信录:
<key>NSContactsUsageDescription</key>
<string>访问通信录</string>
方式二:
在工程找到 info.plist 文件,打开plist文件,直接添加。
![](https://img.haomeiwen.com/i2559321/f4c40c812ba03e7c.png)
Value部分的文字是展示给用户看的,小编试了一下是必填的(其他权限,希望大家积极评论)。
添加相册权限后的效果:
![](https://img.haomeiwen.com/i2559321/e1e99874e751fd3a.png)
![](https://img.haomeiwen.com/i2559321/95e91eb90ad93e30.png)
如果Value文字为空,运行是没有问题的。但是打包提交,会收到苹果的反馈邮件,如下:
![](https://img.haomeiwen.com/i2559321/4bfe22cc5bf9b807.png)
二:如何避免类似问题
其实这种问题解决起来很简单(根据苹果的反馈邮件),只是我们发现这个问题的过程很难,为什么呢?
1、我们每次提交一个版本后,苹果都会给 “公司邮箱”(注册苹果开发者账号的邮箱)发一封邮件。作为开发者,如果能第一时间收到这个邮件(下图:苹果反馈邮件),那么我们会避免浪费很多时间。
2、可是往往开发者账号都是用公司邮箱注册的,不可能将邮箱密码授权给开发人员。所以,我们可以通过这种方式,在 iTunes Connect 里将自己添加为开发人员,这样每次苹果也会给你发一封提交反馈邮件。
通过下面的邮件,我们可以很清楚看到,工程中缺少什么权限
![](https://img.haomeiwen.com/i2559321/34b52a3c4c636f3e.png)
添加iTunes Connect 开发人员:
登录iTunes Connect -> 选择用户和职能 -> 添加 iTunes Connect 用户 -> 填写用户信息 -> 选择职能权限(如:开发人员) -> ... -> OK
![](https://img.haomeiwen.com/i2559321/e9111acac86b33f4.png)
![](https://img.haomeiwen.com/i2559321/d42dfcdbf88c6e39.png)
![](https://img.haomeiwen.com/i2559321/ed3175560a2c8108.png)
![](https://img.haomeiwen.com/i2559321/1b1290d381dceed5.png)
这样你就是苹果的开发人员了,希望这篇文章对大家解决问题能有所帮助。
网友评论
We have discovered one or more issues with your recent delivery for "项目名". To process your delivery, the following issues must be corrected:
Invalid Bundle Structure - The binary file 'xss.app/AlipaySDK.bundle/Lib/jpush-ios-3.0.1.a' is not permitted. Your app can’t contain standalone executables or libraries, other than the CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide for information on the iOS app bundle structure.
Invalid Bundle Structure - The binary file 'xss.app/AlipaySDK.bundle/Lib/jcore-ios-1.1.0.a' is not permitted. Your app can’t contain standalone executables or libraries, other than the CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide for information on the iOS app bundle structure.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team
接手别人的项目上架 jpush-ios-3.0.1.a是极光推送的库.大神该怎么解决