与dotenv一起使用fastlane供应商

问题描述 投票:0回答:1

上下文和示例配置

为了在项目中首次设置快速通道,我定义了不同的。env文件,如in fastlane's FAQ中所述,我想与dotenv一起使用。

示例。env.dev文件:

JSON_KEY_FILE="/home/sam/.keys/googleplay/magnet.json"

在我的[[Appfile中,我使用ENV引用了它,如thisthis堆栈溢出答案中所建议:

# 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

中,而不是在单独的文件中,该怎么办?
android ios fastlane
1个回答
0
投票
[Fastlane操作不像泳道一样支持--env变量。

要解决此问题,只需在运行操作命令之前先获取环境文件:

source fastlane/.env.custom; bundle exec fastlane supply init

© www.soinside.com 2019 - 2024. All rights reserved.