"cmdline-tools component is missing" error shown by flutter doctor

133 views Asked by At

I am trying to build an app with flutter but without android studio. So I was installing the command line tools and started facing issues. Lots of issues.

After I installed the sdkmanager files with sdkmanager --instal ____, the installation happened and the files were installed. I was looking at a tutorial post for installing it, I was told to put all the cmdline-tools files into a tools folder which is also inside the cmdline-tools folder. So in the end the path looked like this: /android/sdk/cmdline-tools/tools/..

But after installation, there were more files created and that outside the cmdline-tools folder. The whole tools folder with pretty much all the content of the folder was again created outside cmdline-tools folder. All new folders like, build-tools, platform-tools were outside the cmdline-tools folder. Is this how it should be?

I am getting quit confused over this. Been at it for this whole day.

Here is what flutter doctor shows me. It shows the Android SDK location at first dot, but then says, "Unable to locate..". Why?

[!] Android toolchain - develop for Android devices
    • Android SDK at /home/sidam/android/sdk
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

    • ANDROID_HOME = /home/sidam/android/sdk
    ✗ Android SDK file not found: adb.
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions.

There are other problems but I'm trying to fix them one by one.

Here's my .bashrc file.

export PATH="$PATH:/home/sidam/android/cmdline-tools/tools/bin/"
export PATH="$PATH:/home/sidam/development/flutter/bin/"

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin

export ANDROID_HOME=/home/sidam/android/cmdline-tools
export PATH=$PATH:$ANDROID_HOME/tools
export ANDROID_SDK_ROOT=/home/sidam/android/cmdline-tools

export GRADLE_HOME=/opt/gradle/gradle-8.4
export PATH=$GRADLE_HOME/bin:$PATH

I have tried a lot to install it. Removed the whole folders and tried to install again because of some other problems caused by this. In the end, all the problems get fixed but this remains.

I also tried the flutter config command and found out that none of the settings were saved. I don't know how or why. I tried to manually add the paths to the settings. But no help. Maybe I am doing the right thing but the wrong way. Or installing and removing multiple times has created some mishaps.

I also had the Android Studio installed a couple weeks back, could remaining files of the software be messing some things up.

I have also searched about this issue, but all the solutions included installed Android Studio and here I was trying to do this without it.

I am a novice trying to get my hands on app development, but am stuck. So show some mercy and please don't get angry if it all was happening because I was doing something really stupid.

Thank You

0

There are 0 answers