在 Flutter 中从 APK 中提取 SHA 密钥时出错

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

我想获取 SHA 密钥以在 firebase 上上传。我正在使用以下命令

keytool -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore

但是得到以下异常

keytool error: java.io.IOException: Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available
java.io.IOException: Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available
        at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2167)
        at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:222)
        at java.base/java.security.KeyStore.load(KeyStore.java:1479)
        at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1058)
        at java.base/sun.security.tools.keytool.Main.run(Main.java:405)
        at java.base/sun.security.tools.keytool.Main.main(Main.java:398)
Caused by: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available
        at java.base/javax.crypto.Mac.getInstance(Mac.java:191)
        at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2145)
        ... 5 more

颤振医生:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.12, on Deepin 20.9 5.15.77-amd64-desktop, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Community Edition (version 2023.1)
[✓] VS Code (version 1.78.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

操作系统:Linux深度版本20

android flutter dart apk sha
1个回答
0
投票

在您的android文件夹中,右键单击gradlew并说在终端中打开运行此命令

gradlew signingReport

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