Willy
Willy

Reputation: 29

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/

Upvotes: 0

Views: 2184

Answers (2)

Sonu Saini
Sonu Saini

Reputation: 2084

  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 :)

Upvotes: 3

Crazy Lazy Cat
Crazy Lazy Cat

Reputation: 15103

You can add Android SDK to path variable.

Add ...\AndroidSDK\platform-tools to your path.

Upvotes: 0

Related Questions