|
|
爱旅游的山寨机 · 一个表名作为一个变量· 2 年前 · |
|
|
冲动的凉茶 · ABSP第14章:处理CSV和JSON文件( ...· 2 年前 · |
|
|
含蓄的保温杯 · 关于SQL的基础语法 - 知乎· 2 年前 · |
正在尝试为android构建版本。我在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.
At line:1 char:1
+ keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -val ...
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (keytool:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我运行flutter doctor -v,并使用路径获取此
Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
,并将java替换为keytool(如文档中所示),但仍收到错误。我该怎么做?
发布于 2019-11-19 22:52:17
创建密钥库如果您已有密钥库,请跳到下一步。如果没有,请在命令行中运行以下命令来创建一个:
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
注意:将此文件保持为私有;不要将其签入公共源代码管理。
注意: keytool可能不在您的路径中。它是Java JDK的一部分,Java JDK作为Android Studio的一部分安装。对于具体的路径,运行flutter doctor -v并查看打印在‘java binary at:’之后的路径,然后使用该完全限定的路径替换java为keytool。
storePassword=password from previous step
keyPassword=password from previous step
keyAlias=key
storeFile=location of the key store file, e.g. /Users/user name/key.jks
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
buildTypes {
release {
signingConfig signingConfigs.release
}
查看本教程的描述: https://www.youtube.com/watch?v=nGvPNG-f1-o
或者使用工具生成密钥
应用签名工具下载地址: https://shatter-box.com/knowledgebase/android-apk-signing-tool-apk-signer/
转到Java二进制文件目录: C:\Program Files\Android\Android Studio\jre\bin\java
然后键入cmd并输入 enter image description here
按照视频教程生成密钥,将密钥放在您想要的任何位置,然后按照下一个教程在第一个教程中使用app包装密钥。
发布于 2018-07-26 01:22:13
尝试从普通的Windows命令提示符运行它
D:\temp>"c:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -help
Key and Certificate Management Tool
Commands: