Reputation: 422
I am trying to install Flutter without Android Studio and here is what I did:
C:\src
.C:\Android
.Now when I try to run sdkmanager
to install Android SDK, I get this error:
"Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli"
I have tried reinstalling Flutter sdk and the sdkmanager with no luck.
Here is Flutter Doctor's output:
Upvotes: 17
Views: 50452
Reputation: 1
download jdk 11 and update ev JAVA_HOME to C:\Program Files\Java\jdk-11.0.17
Upvotes: 0
Reputation: 1
The problem may be due to the fact that your sdk installation failed severally before finally installing. To check if that is the case, go the path C:\Users<username>\AppData\Local\Android\Sdk and if there are tools, tools-1, ... The necessary files are installed in the last of this folder. So, rename the supposed original folder - tools, to something else and change the name of the one in which the installation is done to tools. This should solve the problem.
Upvotes: 0
Reputation: 1051
Go to android sdk folder.
Open cmdline-tools folder.
Then rename "latest" folder as "tools".
Default name: (Path to sdk)\AndroidSDK\cmdline-tools\latest
After rename: (Path to sdk)\AndroidSDK\cmdline-tools\tools
Then;
run flutter doctor
command using terminal.
Upvotes: 3
Reputation: 115
I fixed this issue by removing a space in my path where i had extracted the cmd tools. My path was:
C:\Cordova Tools\cmdline-tools
there was a space in folder name "Cordova Tools". I removed the space and changed folder name like:
C:\Cordova_Tools\cmdline-tools
And it worked just perfectly.
Upvotes: 0
Reputation: 12677
On Windows Server 2019, using commandlinetools-win-6609375_latest.zip, we faced the same issue. We placed package inside Program File (i.e. C:\Program Files\Android\cmdline-tools\tools\bin).
It seems this will not work if there is space in the path. So we placed it in folder path without spaces (i.e. C:\Android\cmdline-tools\tools\bin) and it is working fine!🎉
Upvotes: 7
Reputation: 126
C:\Users\<username>\AppData\Local\Android\Sdk\tools\bin
and C:\Users\<username>\AppData\Local\Android\Sdk\lib
) and run sdkmanager
on command prompt.Upvotes: 11
Reputation: 17
I have solved this issue by doing so many things.
flutter doctor --android-licenses
y
multiple times and at last your licenses will be accepted.flutter doctor
Upvotes: 1
Reputation: 41
It worked for me.
Make sure there exists no space in the path folders in the path to SDK.
example: C:\Users\Anu Jadav\xyz\
like above in username I had space, Initially, I was not able to execute flutter doctor --android-licenses.
After I renamed the username. Then it worked like a charm. I renamed my username using this reference video
.
Upvotes: 3
Reputation: 1
Firstly open android studio and from there open sdk manager and install required sdk tools then -
--The setup should be done and just check by running flutter doctor.
Upvotes: 0
Reputation: 3180
As @Chrishan wrote Avoid using default windows extractor
.
You can use the PowerShell:
Expand-Archive commandlinetools....zip C:\Android\Sdk
Upvotes: 4
Reputation: 1994
Open the sdkmanager.bat
in a text editor and add echo %CLASSPATH%
just below the CLASSPATH=%APP_HOME%\...\sdkmanager-classpath.jar
. Then run sdkmanager --help
which will echo the CLASSPATH of the required file. And check whether is it the valid path.
In my case, it was the wrong path,
It said my sdkmanger-classpath.jar
is in lib
folder. But it was not! It was actually inside the lib/_
folder. So as the simple solution what I did was copy the content in side lib/_
folder to lib
. Then it worked fine!
Upvotes: 16
Reputation: 21
I fixed by adding '--sdkroot ' pointing to the root folder (i.e. parent of bin). e.g. % ./bin/sdkamanager --sdkroot .
Upvotes: 1