使用EAS构建Expo iOS应用时创建Provisioning Profile失败求助
问题
我用Expo开发了一款新应用,打算通过EAS构建上传到App Store,几个月前我已经上传过一款应用。执行eas build --platform ios的步骤如下:
- 登录Apple账号,确认ID无误
- 系统恢复本地会话,显示团队及提供者信息,提示登录成功
- 提示Bundle identifier已注册,同步了Push Notifications等功能,获取到Apple分发证书
- 选择复用现有分发证书,生成新的Apple Provisioning Profile
随后出现错误:
✖ Failed to create Apple provisioning profile
Failed to set up credentials.
There is a problem with the request entity - You are not allowed to create 'iOS' profile with App ID 'APP ID'.
Error: build command failed.
登录开发者账号后,找不到错误日志里提到的这个App ID,我的app.json配置如下:
{"expo": {"name": "My Apps Name","slug": "MyAppsName","version": "1.0.3","orientation": "portrait","icon": "./assets/icon.png","userInterfaceStyle": "light","splash": {"image": "./assets/splash.png","resizeMode": "contain","backgroundColor": "#202022"},"assetBundlePatterns": ["**/*"],"ios": {"supportsTablet": true,"bundleIdentifier": "my.package.url","buildNumber": "1","infoPlist": {"NSMicrophoneUsageDescription": "This app uses the microphone to allow you to capture audio as a note.","NSPhotoLibraryUsageDescription": "This app needs access to the photo library to allow you to upload photos as notes.","NSCameraUsageDescription": "This app uses the camera to allow you to capture photos as notes.","NSLocationWhenInUseUsageDescription": "This app needs access to your location to allow you to capture your location as a note."}},"android": {"package": "my.package.url","versionCode": 5,"adaptiveIcon": {"foregroundImage": "./assets/adaptive-icon.png","backgroundColor": "#202022"},"permissions": ["android.permission.INTERNET","android.permission.READ_EXTERNAL_STORAGE","android.permission.WRITE_EXTERNAL_STORAGE","android.permission.MODIFY_AUDIO_SETTINGS","android.permission.AUDIO_CAPTURE","android.permission.CAMERA","android.permission.RECORD_AUDIO","android.permission.ACCESS_FINE_LOCATION","android.permission.ACCESS_COARSE_LOCATION","android.permission.FOREGROUND_SERVICE"]},"web": {"favicon": "./assets/favicon.png"},"extra": {"eas": {"projectId": "my-project-id"}}}}
解决方案
1. 清除EAS本地凭据缓存
EAS可能缓存了旧的App ID或团队信息,导致自动复用出错,执行命令清除缓存:
eas credentials manager clear
重新运行eas build --platform ios,全程手动选择团队、证书和配置文件,不要依赖自动选择。
2. 核对App ID的实际状态
- 登录Apple开发者后台,检查
my.package.url这个Bundle ID是否存在(注意大小写敏感,Apple后台的Bundle ID区分大小写) - 如果不存在,手动创建该App ID,确保启用Push Notifications等所需功能,再重新构建
- 如果存在,确认App ID类型:必须是Explicit App ID,Wildcard类型的App ID无法生成特定的iOS分发配置文件
3. 验证团队权限
- 确认当前登录的Apple账号拥有该开发者团队的Admin或App Manager权限,普通成员没有创建/修改Provisioning Profile的权限
- 检查EAS登录后显示的团队信息,是否和你要使用的开发者团队一致(多团队/多提供者环境下容易选错)
4. 检查app.json配置准确性
- 确认
ios.bundleIdentifier字段和Apple后台的App ID完全一致,没有拼写错误、空格或特殊字符 - 排查是否有第三方Expo插件自动修改了App ID(比如部分推送插件可能会生成关联App ID但未同步到开发者后台)
5. 手动生成并导入Provisioning Profile
如果自动生成失败,手动在Apple开发者后台操作:
- 创建iOS分发配置文件,选择对应的App ID和分发证书
- 下载生成的
.mobileprovision文件 - 运行
eas credentials,选择手动上传配置文件,指定下载的文件路径,再重新执行构建命令
内容的提问来源于stack exchange,提问作者Tsabary
相关产品推荐
相关产品推荐

