-1

I have tried to download flutter in Ubuntu, i encountered error after running flutter doctor.

[✗] Android toolchain - develop for Android devices ✗ 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.

I want to download flutter in Ubuntu but I'm getting error with android sdk

sudo apt-get install
clang cmake git
ninja-build pkg-config
libgtk-3-dev liblzma-dev
libstdc++-12-dev

Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package libstdc++-12-dev E: Couldn't find any package by regex 'libstdc++-12-dev'

4
  • Did you try this method docs.flutter.dev/get-started/install/linux/desktop ? Commented Aug 2, 2024 at 11:22
  • 1
    i'm getting error in that too. sudo apt-get install \ > clang cmake git \ > ninja-build pkg-config \ > libgtk-3-dev liblzma-dev \ > libstdc++-12-dev Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libstdc++-12-dev E: Couldn't find any package by regex 'libstdc++-12-dev' Commented Aug 2, 2024 at 11:26
  • Can you add this comment as extension to your question and add code in a better formatted way. Commented Aug 2, 2024 at 11:27
  • Okay, I have changed. Commented Aug 2, 2024 at 11:30

1 Answer 1

1
  1. To resolve the issue with the Android SDK, you need to install Android Studio. Android Studio will guide you through installing the necessary Android SDK components.

You can download Android Studio from here: https://developer.android.com/studio. Follow the installation instructions provided on the site.

  1. If you have installed the Android SDK in a custom location, you need to update Flutter's configuration to point to the correct path.

Run the following command to set the SDK path: flutter config --android-sdk <path-to-your-sdk>

Note- Replace with the actual path where the Android SDK is installed.

  1. First, update the package list to ensure you have the latest information about available packages: sudo apt-get update

  2. The libstdc++-12-dev package might not be available on older Ubuntu versions. Instead, install the libstdc++-10-dev package, which should be available and is compatible with most setups: sudo apt-get install libstdc++-10-dev

  3. Ensure that you have all other required dependencies installed by running: sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev

  4. After completing the above steps, run flutter doctor again to check if the issues have been resolved: flutter doctor

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.