为了在项目中首次设置快速通道,我定义了不同的。env文件,如in fastlane's FAQ中所述,我想与dotenv一起使用。
示例。env.dev文件:
JSON_KEY_FILE="/home/sam/.keys/googleplay/magnet.json"
在我的[[Appfile中,我使用ENV引用了它,如this和this堆栈溢出答案中所建议:
# Path to Google Developer Console key
json_key_file ENV["JSON_KEY_FILE"]
# Package name of the project. If not included in the environment, default value is used.
package_name ENV["PACKAGE_NAME"] || cl.magnet.androidfastlanetest
我的问题
我无法通过"Fetch your app metadata" step of fastlane's setup,因为在使用
fastlane supply init
选项运行--env
时出现错误:
~/repos/android-fastlane-test|master⚡ ⇒ fastlane supply init --env dev undefined local variable or method `cl' for #<CredentialsManager::AppfileConfig:0x005560049ed220> undefined local variable or method `cl' for #<CredentialsManager::AppfileConfig:0x005560049e2eb0> undefined local variable or method `cl' for #<CredentialsManager::AppfileConfig:0x005560055588f8> undefined local variable or method `cl' for #<CredentialsManager::AppfileConfig:0x005560055368c0> undefined local variable or method `cl' for #<CredentialsManager::AppfileConfig:0x0055600551a698> undefined local variable or method `cl' for #<CredentialsManager::AppfileConfig:0x005560054fe6f0> undefined local variable or method `cl' for #<CredentialsManager::AppfileConfig:0x005560054e6b18> invalid option: --env
我究竟做错了什么?鉴于我需要将中,而不是在单独的文件中,该怎么办?JSON_KEY_FILE
的路径保存在Appconfig
要解决此问题,只需在运行操作命令之前先获取环境文件:
source fastlane/.env.custom; bundle exec fastlane supply init