Skip to content
Advertisement

Can’t change flutter android-sdk path

I’m setting up flutter in my laptop (Elementary OS), the case is I’m trying to be able develop flutter without Android Studio and using VSCode to make it lightweight, the step I did is installing flutter, download manually android-sdk, and move it to usr/lib/Android, install gradle, and openJDK8,

I did setting up Android Environtment, export ANDROID_HOME to usr/lib/Android, setting up with sdkmanager to download system-images, etc

I can run the flutter command on terminal, the problem is in the android-sdk path, I already changed the config with flutter config --android-sdk /usr/lib/Android, but, the flutter doctor -v command shows

[!] Android toolchain - develop for Android devices
    • Android SDK at /usr/lib/android-sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    ✗ 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/setup/#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.

and the flutter config command shows

Settings:
  android-sdk: /usr/lib/Android/

Advertisement

Answer

  1. you can try this. flutter config –android-sdk < path-to-your-android-sdk-path>
  2. export ANDROID_SDK_ROOT=”/Users/$USER/Library/Android/sdk” export ANDROID_HOME=$ANDROID_SDK_ROOT

HAPPY CODING 🙂

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement