如何修复 fastlane 错误:找不到用于签名配置“externalOverride”的密钥库文件“keystore.jks”。?

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

我是 fastlane 的新手,当我编写用于部署应用程序以进行内部测试的命令时,它向我显示以下错误:

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

错误似乎是因为密钥库的位置,我已经将密钥库放在项目的应用程序文件中,我在其他项目中这样做并且它工作正常,但我不知道为什么它不起作用

我也尝试更改密钥库位置但仍然

fastfile 中的这条车道:

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
java android deployment keystore fastlane
3个回答
9
投票

正如@Rooh Al-mahaba 所说,我必须提供完整的文件路径 作为

"android.injected.signing.store.file"
的值。

另外,

~/
没用;我需要明确拼出完整的文件路径。


7
投票

信息:对于其他用户:

你可以创建多个 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 变量。


2
投票

Flutter + Fastlane + GitHub Actions

我有同样的问题,就我而言,我能够通过将密钥库文件放在

./android/fastlane/
./android/app/fastlane/
文件夹中来使其工作。

那是因为我的 Fastlane 配置在

./android/fastlane/
文件夹中,但是,当您运行 build_android_app / gradle 任务时,它会默认尝试在
./android/app/
文件夹中获取密钥库文件,而您 不能 告诉它做其他事情,除非你使用绝对路径(不是一个好的做法),因为 Fastlane 任务无法解析相对路径。此外,如果我要从
./android/fastlane/
文件夹中删除密钥库文件,它会抱怨,即使它存在于
./android/app/fastlane/
.

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