如题,用三个不同版本jdk生成jks文件,并配置到Android Studio里面验证,结果如下:
jdk1.8:正常
jdk11、jdk17:出错,错误日志如下
FAILURE: Build completed with 2 failures.1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:packageDebugAndroidTest'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable> com.android.ide.common.signing.KeytoolException: Failed to read key test from store "D:\AS_Project\AiDemo\app\test.jks": Invalid keystore format* 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.
==============================================================================2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable> com.android.ide.common.signing.KeytoolException: Failed to read key test from store "D:\AS_Project\AiDemo\app\test.jks": Invalid keystore format* 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.orgDeprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warningsBUILD FAILED in 32s
94 actionable tasks: 17 executed, 77 up-to-date
结论:生成签名文件,建议使用jdk1.8