额外资源
复制一个包含安装步骤和本插件的完整 Markdown 指南的配置提示。
解决常见问题:使用 Capgo Cloud Build 构建原生应用时的故障排除。
”Upload failed” or “Connection timeout”
Section titled “”Upload failed” or “Connection timeout””Section titled “ 。。””
- 症状:
- 项目上传时构建失败
60秒后超时错误
-
解决方案:
检查您的网络连接 # Test connection to Capgocurl -I https://api.capgo.app -
复制到剪贴板
- 减少项目大小
node_modules/正在上传(应自动排除) - 检查项目中的大文件:
终端窗口 find . -type f -size +10M - 减少项目大小
-
检查上传 URL 是否过期
- 上传 URL 将在 1 小时后过期
- 如果出现过期 URL 错误,请重新运行构建命令
”10 分钟后超时”
标题:”10 分钟后超时””症状:
- 构建超出允许的最大时间
- 状态显示
timeout
解决方案:
-
优化依赖项
- 移除未使用的npm包
- 在构建之前使用
npm prune --production检查构建过程中的网络问题
-
一些依赖项可能在构建过程中下载大文件
- Section titled “”Build timeout after 10 minutes””
- 考虑使用锁文件进行预缓存
-
查看本机依赖项
终端窗口 # iOS - check Podfile for heavy dependenciescat ios/App/Podfile# Android - check build.gradlecat android/app/build.gradle -
联系支持
- 如果您的应用程序合法地需要更多时间
- 我们可以根据具体用例调整限制
身份验证问题
身份验证问题”API key invalid” or “Unauthorized”
APIkey无效”或“未授权””
- 构建立即失败,出现认证错误
- 401 或 403 错误
解决方案:
-
验证API密钥是否正确
终端窗口 # Test with a simple commandbunx @capgo/cli@latest app list -
检查API密钥权限
- 密钥必须具有
write或all检查__CAPGO_KEEP_0__密钥权限 - 检查Capgo控制台下的API密钥
- 密钥必须具有
-
确保API密钥正在被读取
终端窗口 # Check environment variableecho $CAPGO_TOKEN# Or check your saved credentials filecat ~/.capgo-credentials/credentials.json # globalcat .capgo-credentials.json # local (--local) -
重新验证
终端窗口 bunx @capgo/cli@latest login
”App not found” or “No permission for this app”
Section titled “”App not found” or “No permission for this app””Symptoms:
- Authentication works but app-specific error
Solutions:
-
Verify app is registered
Terminal window bunx @capgo/cli@latest app list -
检查应用 ID 是否匹配
- 验证
capacitor.config.jsonappId - 确保命令使用正确的应用 ID
- 验证
-
验证组织访问权限
- 检查您是否在正确的组织中
- API key 必须具有对应用组织的访问权限
iOS 构建问题
iOS 构建问题”Code signing failed”
Section titled “”Code signing failed””问题:
- code 签名阶段构建失败
- Xcode 错误:证书或配置文件问题
解决方案:
-
确认证书类型与构建类型匹配
- 开发构建需要开发证书
- App Store 构建需要发布证书
-
检查证书和配置文件是否匹配
终端窗口 # Decode and inspect your certificateecho $BUILD_CERTIFICATE_BASE64 | base64 -d > cert.p12openssl pkcs12 -in cert.p12 -nokeys -passin pass:$P12_PASSWORD | openssl x509 -noout -subject -
确保配置文件有效
- 检查过期日期
- 验证它包含您的 App ID
- 确认它包含证书
-
重新生成凭据
- 删除旧的证书/配置文件
- 在 Apple Developer portal 中创建新的
- 重新编码并更新环境变量
”Provisioning profile doesn’t include signing certificate”
Section titled “”Provisioning profile doesn’t include signing certificate””Symptoms:
- Xcode can’t find certificate in profile
Solutions:
-
解决方案:下载最新的配置文件
- 前往 Apple Developer → 证书、ID 和配置文件
- 下载配置文件
- 确保包含您的证书
-
验证证书是否在配置文件中
终端窗口 # Extract profileecho $BUILD_PROVISION_PROFILE_BASE64 | base64 -d > profile.mobileprovision# View profile contentssecurity cms -D -i profile.mobileprovision -
使用正确的证书重新创建配置文件
- 在 Apple Developer 门户中编辑配置文件
- 确保已选择您的发布证书
- 下载并重新编码
App Store Connect 身份验证失败
App Store Connect 身份验证失败问题:
- 向 TestFlight 发布失败
- API 键错误
解决方案:
-
验证API键凭证
- 检查 APPLE_KEY_ID(应为 10 个字符)
- 检查 APPLE_ISSUER_ID(应为 UUID 格式)
- 验证 APPLE_KEY_CONTENT 是否正确 base64 编码
-
同步计算机时钟
- App Store Connect 认证使用从本地系统时间生成的短期 JWT
- Apple 拒绝过期时间超过 20 分钟的令牌,因此即使是微小的时钟漂移也会使一个原本有效的密钥失败
- 在 Windows 上打开 设置 > 时区和语言 > 日期和时间 然后点击 立即同步
- 在 macOS 上,打开 系统设置 > 常规 > 日期和时间 并启用自动时间同步
- 在 Linux 上,检查
timedatectl status并如果需要启用 NTP - 同步后重新运行 Capgo 构建或凭据命令
参见 Apple 的 为 API 请求生成令牌的文档 了解 App Store Connect 令牌生命周期规则
-
测试 API 本地密钥
终端窗口 # Decode keyecho $APPLE_KEY_CONTENT | base64 -d > AuthKey.p8# Test with fastlane (if installed)fastlane pilot list -
检查 API 密钥权限
- 密钥需要“开发者”角色或更高
- 在 App Store Connect -> 用户和访问 -> 密钥中验证
-
确保密钥未被撤销
- 在 App Store Connect 中检查
- 如果需要,请生成新密钥
“Pod 安装失败”
标题:“Pod 安装失败”症状:
- 构建在 CocoaPods 安装期间失败
- Podfile 错误
解决方案:
-
验证 Podfile.lock 已提交
终端窗口 git status ios/App/Podfile.lock -
测试本地 pod install
终端窗口 cd ios/Apppod install -
检查不兼容的 pods
- 检查 Podfile 版本冲突
- 确保所有 pods 支持您的 iOS 部署目标
-
清除 Pod 缓存
终端窗口 cd ios/Apprm -rf Podsrm Podfile.lockpod install# Then commit new Podfile.lock
安卓构建问题
安卓构建问题”Keystore password incorrect”
Section titled “”Keystore password incorrect””症状:
- 签名过程中构建失败
- Gradle 错误关于密钥库
解决方案:
-
验证密钥库密码
终端窗口 # Test keystore locallykeytool -list -keystore my-release-key.keystore# Enter password when prompted -
检查环境变量
终端窗口 # Ensure no extra spaces or special charactersecho "$KEYSTORE_STORE_PASSWORD" | cat -Aecho "$KEYSTORE_KEY_PASSWORD" | cat -A -
验证Base64编码
终端窗口 # Decode and testecho $ANDROID_KEYSTORE_FILE | base64 -d > test.keystorekeytool -list -keystore test.keystore
”Key alias not found”
Section titled “”Key alias not found””Symptoms:
- Signing fails with alias error
解决方案:
-
列出密钥库别名
终端窗口 keytool -list -keystore my-release-key.keystore -
确认别名完全匹配
- 别名区分大小写
- 检查KEYSTORE_KEY_ALIAS中的拼写错误
-
使用密钥库中的正确别名
终端窗口 # Update environment variable to matchexport KEYSTORE_KEY_ALIAS="the-exact-alias-name"
”Gradle build failed”
Gradle构建失败问题:
- Gradle通用错误
- 编译或依赖问题
解决方案:
-
先在本地测试构建
终端窗口 cd android./gradlew clean./gradlew assembleRelease -
检查缺失的依赖项
- 检查build.gradle文件
- 确保所有插件都列在依赖项中
-
验证Gradle版本兼容性
终端窗口 # Check gradle versioncat android/gradle/wrapper/gradle-wrapper.properties -
清除Gradle缓存
终端窗口 cd android./gradlew cleanrm -rf .gradle build
”Play Store upload failed”
Section titled “”Play Store upload failed””Symptoms:
- Build succeeds but upload fails
- Service account errors
Solutions:
-
Verify service account JSON
Terminal window # Decode and check formatecho $PLAY_CONFIG_JSON | base64 -d | jq . -
检查服务帐户权限
- 前往 Google Play Console → 设置 → API 访问
- 确保服务帐户有权访问您的应用
- 授予“发布到测试渠道”权限
-
验证应用已在 Google Play Console 中设置
- 应用必须先在 Google Play Console 中创建
- 至少需要手动上传一个 APK
-
检查 API 是否启用
- 必须在 Google Cloud Console 中启用 Google Play Developer API
- 检查 Google Cloud Console
”Job not found” or “Build status unavailable”
Section titled “”症状:
- 无法检查构建状态
- Job ID 错误
解决方案:
-
稍等一下,重新尝试
- 构建作业可能需要几秒钟来初始化
-
检查作业 ID 是否正确
- 从初始构建响应中验证作业 ID
-
检查构建是否过期
- 24 小时内可用
”Project sync failed”
Section titled “”Project sync failed””Symptoms:
- Build fails before compilation starts
- Missing files errors
Solutions:
-
Run Capacitor sync locally
Terminal window bunx cap sync -
Ensure all native files are committed
Terminal window git status ios/ android/ -
检查被忽略的本机文件
- 查看 .gitignore
- 确保重要的配置文件未被忽略
“我成功构建了项目,但无法看到输出”
标题:“我成功构建了项目,但无法看到输出”症状:
- 构建显示成功但无下载链接
解决方案:
-
检查构建配置
- 可能的存储位置未配置
- 如果您的构建无法访问存储位置,请联系支持
-
iOS测试飞行提交
- 检查App Store Connect
- 上传后处理可能需要5-30分钟
-
Android Play Store
- 检查Play Console → Testing → Internal testing
- 处理可能需要几分钟
CI/CD特定问题
CI/CD特定问题GitHub操作:“命令未找到”
Section titled “GitHub Actions: “Command not found””症状:
bunx @capgo/cli@latest …CI中出现“命令未找到”错误
解决方案:
-
首先设置 Bun 所以
bunx可用:- uses: oven-sh/setup-bun@v2 -
然后运行 CLI —
bunx它在需要时动态获取,不需要全局安装:- run: bunx @capgo/cli@latest build request com.example.app --platform android
GitHub 动作: “找不到密钥”
标题为 “GitHub 动作: “找不到密钥””症状:
- 构建环境变量为空
解决方案:
-
验证密钥是否已设置
- 前往仓库设置 → 秘密和变量 → 动作
- 添加所有必需的密钥
-
使用正确的语法
env:CAPGO_TOKEN: ${{ secrets.CAPGO_TOKEN }} -
检查密钥名称是否匹配
- 名称区分大小写
- 密钥引用中无拼写错误
获取更多帮助
标题为“获取更多帮助”启用详细日志记录
Section titled “开启详细日志”# Add debug flag (when available)bunx @capgo/cli@latest build request com.example.app --verbose收集构建信息
Section titled “收集构建信息”与支持人员联系时,请包含:
-
构建命令
终端窗口 bunx @capgo/cli@latest build request com.example.app --platform ios -
错误信息 (完整输出)
-
作业 ID (来自构建输出)
-
构建日志 (复制全屏终端输出)
-
环境信息
终端窗口 node --versionnpm --versionbunx @capgo/cli@latest --version
联系支持
联系我们的支持团队- Discord: 加入我们的社区
- 电子邮件: support@capgo.app
- 文档: Capgo 文档
已知限制
当前限制:最大构建时间:10分钟
- 最大上传大小:约500MB
- iOS构建需要24小时的Mac租用,构建在Mac上会排队以确保最佳使用
- 构建工件下载可用性取决于构建目的地和工件存储配置
- 这些限制可能会根据反馈进行调整。
预扫描阻止了我的构建
预扫描阻止了我的构建
已知限制Capgo 运行本地 预扫描 上传之前,预扫描会运行。修复报告的发现,或者忽略该检查 id:
npx @capgo/cli@latest build request <appId> --platform ios \ --prescan-skip ios/capacitor-server-url-shipped查看完整目录: 预扫描检查.