Home > Enterprise >  FLUTTER: keytool : The term 'keytool' is not recognized as the name of a cmdlet, function,
FLUTTER: keytool : The term 'keytool' is not recognized as the name of a cmdlet, function,

Time:11-18

I want to release the Android App on VSCode but it got this problem, this is the first time i deploy the app to apk

When i use this command on "flutter deployment web"

 keytool -genkey -v -keystore C:\Users\Admin\Videos\Halloween_Official - 2\official_halloween\android\app\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

I got 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:3
    keytool -genkey -v -keystore C:\Users\Admin\Videos\Halloween_Offici ...
    ~~~~~~~
      CategoryInfo          : ObjectNotFound: (keytool:String) [], CommandNotFoundExceptio
   n
      FullyQualifiedErrorId : CommandNotFoundException

The output of Flutter doctor when i run:

[!] Flutter (Channel master, 3.6.0-1.0.pre.38, on Microsoft Windows [Version
    10.0.22000.1219], locale en-US)
    • Flutter version 3.6.0-1.0.pre.38 on channel master at C:\src\flutter
    ! Warning: `dart` on your path resolves to C:\dart-sdk\bin\dart.exe,    
      which is not inside your current Flutter SDK checkout at
      C:\src\flutter. Consider adding C:\src\flutter\bin to the front of    
      your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 338841afd3 (6 days ago), 2022-11-11 10:01:11 -0800 
    • Engine revision 7326e5b335
    • Dart version 2.19.0 (build 2.19.0-389.0.dev)
    • DevTools version 2.19.0
    • If those were intentional, you can disregard the above warnings;
      however it is recommended to use "git" directly to perform update     
      checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version    
    31.0.0)
    • Android SDK at C:\Users\Admin\AppData\Local\Android\sdk
    • Platform android-Sv2, build-tools 31.0.0
    • Java binary at: C:\Program Files\Java\jdk-15.0.1\bin\java
    X Cannot execute C:\Program Files\Java\jdk-15.0.1\bin\java to determine
      the version

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe       

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows
      development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C  " workload, including 
      all of its default components

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit
      https://flutter.dev/docs/get-started/install/windows#android-setup for
      detailed instructions).

[√] IntelliJ IDEA Community Edition (version 2021.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition
      2021.3
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.73.1)
    • VS Code at C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code    
    • Flutter extension version 3.52.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows
      [Version 10.0.22000.1219]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome
      107.0.5304.107
    • Edge (web)        • edge    • web-javascript • Microsoft Edge
      107.0.1418.42

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 4 categories.

I did all of the above commands on VS Code by using Powershell Terminal. How can i fix this problem

CodePudding user response:

To write up an answer following up on our discussion:

As flutter doctor revelas some problems, you will need to

  • Install Visual Studio Code
  • Install Android Studio. This will provide the JDK and the keytool command with it
  • Related