Expo生产构建IOS端Fastlane执行失败求助
Expo Dev Client iOS生产构建在Fastlane阶段失败(测试环境正常)
问题描述
我正在开发Expo开发客户端(非Expo Go)应用,测试环境下iOS和Android均能正常运行,但执行生产构建时仅Android编译成功,iOS构建在Run Fastlane阶段失败,错误信息如下:
Build failed: Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information. Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
配置文件
app.json
{ "expo": { "name": "myapp", "scheme": "myapp", "version": "2.0.0", "orientation": "portrait", "icon": "iconIOS.png", "updates": { "fallbackToCacheTimeout": 0 }, "assetBundlePatterns": [ "**/*" ], "plugins": [ [ "react-native-fbsdk-next", { "appID": "12", "clientToken": "12", "displayName": "12", "scheme": "12" } ], "@react-native-firebase/app", [ "expo-build-properties", { "ios": { "useFrameworks": "static", "deploymentTarget": "13.0" } } ], "@react-native-firebase/dynamic-links" ], "ios": { "supportsTablet": true, "bundleIdentifier": "myapp.ai.finance", "buildNumber": "3", "use_frameworks": "static", "googleServicesFile": "./GoogleService-Info.plist", "associatedDomains": [ "applinks:myapp.site" ], "infoPlist": { "NSUserTrackingUsageDescription": "This identifier will be used to deliver personalized ads to you.", "SKAdNetworkItems": [ { "SKAdNetworkIdentifier": "v9wttpbfk9.skadnetwork" }, { "SKAdNetworkIdentifier": "n38lu8286q.skadnetwork" } ] } }, "android": { "package": "com.myapp.app", "googleServicesFile": "./google-services.json", "versionCode": 3, "adaptiveIcon": { "foregroundImage": "./src/assets/icons/myapp.png", "backgroundColor": "#FFFFFF" }, "intentFilters": [ { "action": "VIEW", "autoVerify": true, "data": [ { "scheme": "https", "host": "*.site.site", "pathPrefix": "/records" } ], "category": [ "BROWSABLE", "DEFAULT" ] } ], "permissions": [ "android.permission.INTERNET" ] }, "resolutions": { "@expo/config-plugins": "^5.0.2", "@expo/prebuild-config": "~5.0.3", "expo-modules-autolinking": "~1.0.0" }, "extra": { "eas": { "projectId": "id" } } } }
package.json
{ "name": "myapp", "version": "1.0.0", "scripts": { "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web", "dev": "cross-env NODE_OPTIONS='--openssl-legacy-provider' next dev", "eas-build-pre-install": "npm config set legacy-peer-deps true" }, "dependencies": { "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@burstware/expo-plaid-link": "^1.0.6", "@expo/config-plugins": "^5.0.4", "@expo/dev-server": "^0.1.123", "@expo/metro-config": "^0.5.1", "@expo/webpack-config": "^0.17.0", "@react-native-async-storage/async-storage": "~1.17.3", "@react-native-community/datetimepicker": "6.2.0", "@react-native-firebase/app": "^17.0.0", "@react-native-firebase/dynamic-links": "^17.0.0", "@react-navigation/bottom-tabs": "^6.4.0", "@react-navigation/core": "^6.4.1", "@react-navigation/drawer": "^6.5.0", "@react-navigation/native": "^6.0.14", "@react-navigation/native-stack": "^6.9.1", "@react-navigation/stack": "^6.3.2", "axios": "^1.1.3", "cross-env": "^7.0.3", "expo": "~46.0.19", "expo-apple-authentication": "~4.3.0", "expo-auth-session": "~3.7.4", "expo-build-properties": "~0.3.0", "expo-dev-client": "^2.0.1", "expo-device": "~4.3.0", "expo-linear-gradient": "~11.4.0", "expo-navigation-bar": "~1.3.0", "expo-notifications": "~0.16.1", "expo-random": "~12.3.0", "expo-splash-screen": "~0.16.2", "expo-status-bar": "~1.4.0", "expo-web-browser": "~11.0.0", "intl": "^1.2.5", "metro-core": "^0.73.3", "moment": "^2.29.4", "node": "^19.6.0", "react": "18.0.0", "react-content-loader": "^6.2.0", "react-dom": "18.0.0", "react-native": "0.69.6", "react-native-dotenv": "^3.4.7", "react-native-event-listeners": "^1.0.7", "react-native-fbsdk-next": "^11.1.0", "react-native-gesture-handler": "~2.5.0", "react-native-modal": "^13.0.1", "react-native-reanimated": "~2.9.1", "react-native-safe-area-context": "4.3.1", "react-native-screens": "~3.15.0", "react-native-select-dropdown": "^3.2.1", "react-native-svg": "12.3.0", "react-native-svg-charts": "^5.4.0", "react-native-svg-transformer": "^1.0.0", "react-native-swipe-list-view": "^3.2.9", "react-native-vector-icons": "^9.2.0", "react-native-web": "~0.18.7", "react-native-web-webview": "^1.0.2", "react-native-webview": "11.23.0", "react-redux": "^8.0.5", "redux": "^4.2.0", "redux-thunk": "^2.4.2", "yarn": "^1.22.19" }, "devDependencies": { "@babel/core": "^7.12.9", "@types/react-native": "~0.69.1", "metro": "^0.73.3", "typescript": "^4.6.3", "webpack": "^5.75.0", "webpack-cli": "^5.0.0", "webpack-dev-server": "^4.11.1" }, "private": true }
eas.json
{ "build": { "development": { "developmentClient": true, "distribution": "internal", "android": { "gradleCommand": ":app:assembleDebug" }, "ios": { "buildConfiguration": "Debug", "image": "latest" } }, "preview": { "distribution": "internal" }, "production": {} }, "submit": { "production": { "ios": { "appleId": "me@gmail.com", "ascAppId": "1234", "appleTeamId": "4321" } } } }
解决建议
- 优先获取详细日志:在EAS Build控制台展开「Run fastlane」和「Xcode Logs」阶段的完整日志,定位具体错误(比如依赖冲突、签名失败、框架兼容问题),当前的模糊错误提示无法直接定位问题。
- 修复重复的use_frameworks配置:app.json中同时在
expo.plugins.expo-build-properties和ios字段下设置了use_frameworks: static,建议删除ios字段下的该配置,避免重复定义导致的构建冲突。 - 清理无效依赖:package.json中把
node列为依赖是不必要的,移除该条目,避免构建环境的Node版本冲突。 - 验证依赖版本兼容性:Expo 46对应React Native 0.69.6,检查
@react-native-firebase/app@17.0.0、react-native-fbsdk-next@11.1.0是否适配该RN版本,必要时降级到兼容版本。 - 明确生产构建配置:在eas.json的production节点中补充iOS构建参数,指定镜像和Release配置:
"production": { "ios": { "image": "latest", "buildConfiguration": "Release" } } - 清理缓存重新构建:执行
eas build --platform ios --profile production --clear-cache,清除构建缓存后重试。 - 检查签名与配置文件:确认
GoogleService-Info.plist路径正确且包含生产环境配置,同时验证EAS Build的iOS签名配置(证书、Provisioning Profile)是否正确。
内容的提问来源于stack exchange,提问作者JoelE
相关产品推荐
相关产品推荐

