trying to build release for android. I ran keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias
key
in the vscode terminal but I get this error
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
I ran flutter doctor -v and get thisJava binary at: C:\Program Files\Android\Android Studio\jre\bin\java
use the path and replace java with keytool(as in the documentation) but still get error.
what do I do
Try running it from a normal Windows Command Prompt
D:\temp>"c:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -help
Key and Certificate Management Tool
Commands:
-certreq Generates a certificate request
-changealias Changes an entry's alias
-delete Deletes an entry
-exportcert Exports certificate
...
Also, on Windows, you can't use ~/
. Change that to a Windows style path like C:\Users\Norbert\keys
, or wherever you want to keep the keystore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With