androidflutterandroid-sdk-tools

getting error while installing flutter in ubuntu?


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'


Solution

    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