flutter - Codemagic 后克隆脚本因找不到 base64 命令而失败
问题描述
我正在尝试通过自定义脚本解码 Codemagic 上的环境变量值并得到下一个错误:
post-clone script failed on base64 decode. The command could not be found
我使用的脚本:
#!/bin/sh
echo $ANDROID_FIREBASE_JSON | base64 --decode > $FCI_BUILD_DIR/android/app/google-services.json
echo $IOS_FIREBASE_JSON | base64 --decode > $FCI_BUILD_DIR/ios/Runner/GoogleService-Info.plist
解决方案
可能是您使用浏览器不呈现的一些 Unicode 字符复制粘贴了脚本。只需删除base64
命令和--decode
选项之间的空格,然后将其添加回来。
您可以在本文中找到更多信息:https ://medium.com/flutter-community/how-to-load-firebase-config-in-codemagic-with-environment-variables-e36e0378b7e6
推荐阅读
- python - Python pip 安装缺少模块 pkgutil
- node.js - 将 Angular 连接到 nodejs 和 mysql
- android-studio - 如何在android studio中选择整个字符串
- php - PHP Curl 请求在 Postman 环境之外不起作用 - formdata 包含数组
- regex - 正则表达式匹配数据块
- javascript - 在哪里/如何为 Vue Js 方法定义数据中的变量?
- tensorflow - 会话在张量流中不可调用
- javascript - 带有参数的模板函数和异步库
- python - 如何更快地使用熊猫数据框计算字符串相似度
- node.js - 检索存储在我的 Mlab 中的音频 - 二进制文件