【问题标题】:Preparing an Android App for Release准备要发布的 Android 应用程序
【发布时间】:2024-11-24 21:15:01
【问题描述】:

首先,我在 vscode 中输入的终端没有任何效果,总是出现错误 但是当我输入这个时:

keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

在终端中弹出以下消息:

keytool : The term 'keytool' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

当我在颤振控制台中输入相同的内容时,我会收到以下消息:

'keytool' is not recognized as an internal or external command, operable program or batch file.

基本上有人可以帮我解决这些问题

【问题讨论】:

    标签: dart flutter


    【解决方案1】:

    来自docs on preparing an Android app for release

    注意keytool 可能不在您的路径中。它是作为 Android Studio 的一部分安装的 Java JDK 的一部分。对于具体路径,运行flutter doctor -v 并查看在“Java binary at:”之后打印的路径,然后使用该完全限定路径将java 替换为keytool

    在我的机器中,该工具位于

    /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool
    

    【讨论】: