我是快车道的新手,当我编写用于部署应用程序以进行内部测试的命令时,它向我显示以下错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file '/Users/rooh/.gradle/daemon/5.1.1/keystore.jks' not found for signing config 'externalOverride'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
似乎错误是因为密钥库的位置,我已经将密钥库放在项目的应用程序文件中,我在其他项目中这样做并且它的工作正常,但在这里我不知道为什么它不起作用
我也尝试更改密钥库位置,但仍然
快速文件中的这条车道:
desc "Deploy a new internal version to the Google Play Store"
lane :internal do
gradle(task: "clean")
gradle(
task: "assemble",
build_type: "Release",
print_command: false,
properties: {
"android.injected.signing.store.file" => "keystore.jks",
"android.injected.signing.store.password" => "*****",
"android.injected.signing.key.alias" => "alias",
"android.injected.signing.key.password" => "*****"
}
)
changelog = prompt(
text: "Changelog: ",
multi_line_end_keyword: "END"
)
supply(
track: "internal",
apk: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH].to_s
)
upload_to_play_store(track: "internal")
end
正如 Al-mahaba 所说@Rooh,我必须提供完整的文件路径作为"android.injected.signing.store.file"
的值。
此外,~/
不起作用;我需要明确拼写出完整的文件路径。
信息:对于其他用户:
您可以创建多个 ENV 变量,这对 CI 很有用。
build_android_app(
task: "assemble",
build_type: "Release",
flavor: "development",
flags: "--stacktrace",
print_command: false,
properties:{
"android.injected.signing.store.file" => ENV['KEYSTORE_PATH'],
"android.injected.signing.store.password" => ENV['STORE_PASSWORD'],
"android.injected.signing.key.alias" => ENV['KEY_ALIAS'],
"android.injected.signing.key.password" => ENV['KEY_PASSWORD'],
"org.gradle.java.home" => ENV['JAVA_HOME']
})
稍后您需要修改.bash_profile并添加 ENV 变量。
Flutter + Fastlane + GitHub Actions
我遇到了同样的问题,就我而言,我能够通过将密钥库文件放在./android/fastlane/
和./android/app/fastlane/
文件夹中来使其工作。
那是因为我在./android/fastlane/
文件夹中有我的 Fastlane 配置,但是,当您运行build_android_app/gradle任务时,默认情况下它会尝试获取./android/app/
文件夹中的密钥库文件,并且您无法告诉它否则除非您使用绝对路径(不是一个好的做法(,因为 Fastlane 任务无法解析相对路径。此外,如果我从./android/fastlane/
文件夹中删除密钥库文件,即使它存在于./android/app/fastlane/
中,它也会抱怨。