fastlane 运行 自定义 shell 脚本失败
fastlane run custom shell script failed
我的应用程序中集成了 firebase 崩溃报告。根据 Firebase 文档,我应该在 Xcode 构建阶段添加自定义 shell 脚本,如下所示:
JSONF="${PODS_ROOT}/../AppName/Resources/Other/name-firebase-crashreporting-xfgzl-92c3174357.json"
GOOGLE_APP_ID=1:xxxxxxxxxxxx:ios:xxxxxxxxxxxxxxxx
defaults write com.google.SymbolUpload version -integer 1
JSON=$(cat "${JSONF}")
/usr/bin/plutil -replace "app_${GOOGLE_APP_ID//:/_}" -json "${JSON}" "$HOME/Library/Preferences/com.google.SymbolUpload.plist"
"${PODS_ROOT}"/FirebaseCrash/upload-sym -vv "${JSONF}"
如果我使用 Xcode 存档 (UI) 进行存档,我将获得以下日志:
如您所见,如果令牌无效,将发出新请求以获取新请求,到目前为止一切顺利,相反,如果我要求 fastlane
构建项目,我会得到以下:
/Users/xxx/Desktop/s3/njm/name-ios/Pods/FirebaseCrash/upload-sym-util.bash:148: note: access_token not found in
/Users/xxx/Library/Preferences/com.google.SymbolUploadToken.plist. Token invalid.
/Users/xxx/Desktop/s3/njm/name-ios/Pods/FirebaseCrash/upload-sym-util.bash:229: note: Token cannot be used. Requesting OAuth2 token using installed credentials.
/Users/xxx/Desktop/s3/njm/name-ios/Pods/FirebaseCrash/upload-sym-util.bash:235: note: Certificate information appears valid.
* Trying 216.58.204.109...
* Connected to accounts.google.com (216.58.204.109) port 443 (#0)
* SSL: certificate verification failed (result: 5)
* Closing connection 0
Command /bin/sh failed with exit code 1
所以问题出在 curl
certificate verification failed
我是不是遗漏了什么?
按照以下步骤,我可以完成它并且一切正常:
1 - 我从 Homebrew
安装了 curl
: brew install curl --with-openssl
2 - 将 curl
路径指向新安装的路径:brew link --force curl
3 - 运行 这个:curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
我的应用程序中集成了 firebase 崩溃报告。根据 Firebase 文档,我应该在 Xcode 构建阶段添加自定义 shell 脚本,如下所示:
JSONF="${PODS_ROOT}/../AppName/Resources/Other/name-firebase-crashreporting-xfgzl-92c3174357.json"
GOOGLE_APP_ID=1:xxxxxxxxxxxx:ios:xxxxxxxxxxxxxxxx
defaults write com.google.SymbolUpload version -integer 1
JSON=$(cat "${JSONF}")
/usr/bin/plutil -replace "app_${GOOGLE_APP_ID//:/_}" -json "${JSON}" "$HOME/Library/Preferences/com.google.SymbolUpload.plist"
"${PODS_ROOT}"/FirebaseCrash/upload-sym -vv "${JSONF}"
如果我使用 Xcode 存档 (UI) 进行存档,我将获得以下日志:
如您所见,如果令牌无效,将发出新请求以获取新请求,到目前为止一切顺利,相反,如果我要求 fastlane
构建项目,我会得到以下:
/Users/xxx/Desktop/s3/njm/name-ios/Pods/FirebaseCrash/upload-sym-util.bash:148: note: access_token not found in
/Users/xxx/Library/Preferences/com.google.SymbolUploadToken.plist. Token invalid.
/Users/xxx/Desktop/s3/njm/name-ios/Pods/FirebaseCrash/upload-sym-util.bash:229: note: Token cannot be used. Requesting OAuth2 token using installed credentials.
/Users/xxx/Desktop/s3/njm/name-ios/Pods/FirebaseCrash/upload-sym-util.bash:235: note: Certificate information appears valid.
* Trying 216.58.204.109...
* Connected to accounts.google.com (216.58.204.109) port 443 (#0)
* SSL: certificate verification failed (result: 5)
* Closing connection 0
Command /bin/sh failed with exit code 1
所以问题出在 curl
certificate verification failed
我是不是遗漏了什么?
按照以下步骤,我可以完成它并且一切正常:
1 - 我从 Homebrew
安装了 curl
: brew install curl --with-openssl
2 - 将 curl
路径指向新安装的路径:brew link --force curl
3 - 运行 这个:curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem