密钥库密码不正确/Gradle 任务 assembleRelease 失败,退出代码为 1
Posted
技术标签:
【中文标题】密钥库密码不正确/Gradle 任务 assembleRelease 失败,退出代码为 1【英文标题】:keystore password was incorrect/Gradle task assembleRelease failed with exit code 1 【发布时间】:2021-06-10 19:32:14 【问题描述】:在构建我的 APK 时出现此错误: 执行 com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable 时发生故障 和 Gradle 任务 assembleRelease 失败,退出代码为 1
我已确保密码正确。
有什么想法吗?
运行最新的稳定版flutter。
谢谢!
[ ] FAILURE: Build failed with an exception.
[ +1 ms] * What went wrong:
[ ] Execution failed for task ':app:packageRelease'.
[ ] > A failure occurred while executing
com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
[ ] > com.android.ide.common.signing.KeytoolException: Failed to read key key from store "C:\Users\redacted\Desktop\Fluxstore\android\app\key.jks": keystore password was incorrect
[ ] * 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
[ ] BUILD FAILED in 16s
[ +5 ms] Gradle task assembleRelease failed with exit code 1
[ ]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 buildGradleApp (package:flutter_tools/src/android/gradle.dart:411:7)
<asynchronous suspension>
#2 _AndroidBuilderImpl.buildApk (package:flutter_tools/src/android/android_builder.dart:101:7)
<asynchronous suspension>
#3 BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:103:5)
<asynchronous suspension>
#4 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#5 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#8 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#12 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#13 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#14 run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#17 runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#18 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
【问题讨论】:
【参考方案1】:首先请更新您的 sdk(android、dart 和 flutter)
下次运行flutter clean
然后运行flutter build apk --split-per-abi
【讨论】:
【参考方案2】:试过了,没用。
我终于通过完全删除 Android Studio、SDK 和 Flutter 然后重新安装来让它工作。
另外,我的 Android Studio 在安装文件路径中有一个空格。我将它安装到根驱动器,这可能有帮助。
【讨论】:
以上是关于密钥库密码不正确/Gradle 任务 assembleRelease 失败,退出代码为 1的主要内容,如果未能解决你的问题,请参考以下文章
keytool :证书导入给出错误消息 - 密钥库被篡改,或密码不正确
Spring Boot 2.1 嵌入式 Tomcat - 密钥库密码不正确