FLUTTER wont recognize android-sdk

Im trying for a couple of days now, but can’t get it right. I have this defined in user and root .bashrc

export ANDROID_SDK=$PATH:/opt/android-sdk
export ANDROID_PATH=$PATH:/opt/android-sdk/tools:$PATH:opt/android-sdk/platform-tools

on flutter doctor i get

 [ ! ] Unable to locate Android SDK 
            No valid Android SDK platforms found in /opt/android-sdk/platforms.
            Candidates were:
              - android-30

but i got exactly this sdk version…

:point_up: Maybe that’s why. :wink:

error message return “bad” platforms …
I guess you don’t have a platform installed?

ls -l /opt/android-sdk/platforms
# for me : 
#drwxr-xr-x 6 patrick users 4,0K 27 févr. 15:05 android-24
#drwxr-xr-x 6 patrick users 4,0K 26 févr. 22:34 android-29
#drwxr-xr-x 6 patrick users 4,0K 26 févr. 21:32 android-30

and run :

avdmanager list target 
#(same result as ls)
avdmanager list avd
# if empty : create one

typo error in 3 lines :
ANDROID_PATH : not add $PATH and add root at opt/ : /opt
$PATH : (view @Yochanan )

return :
env | grep -Ei “android|path|flutter”

how to installed android-sdk ? is aur package ? if yes var is set in package…

1 Like

sorry, that i did mistype here only. On bashrc it is actually export

Just making sure. :wink:

RTFM (Read The Friendly Manual)

for me

ls -l /opt/android-sdk/platforms


total 4
drwxr-xr-x 6 root root 4096 jul 31 18:17 android-30

avdmanager list target

Availabe Android targets:==========] 100% Fetch remote reporsitory....

id: 1 or "android-30"
	Name: Android API 30
	TYpe: Platform
	API leve: 30
	Revision: 3

and avdmanager list avd

Availabe Android Virtual Devices:


ADROID_PATH : not add $PATH and add root at opt/ : `/opt

you meant like this?

export ANDROID_PATH=/opt/android-sdk/tools:$ROOT:opt/android-sdk/platform-tools

My .bashrc is growing large

export ANDROID_SDK_ROOT=/opt/android-sdk/
export ANDROID_SDK_HOME=/home/gabriel/.android/
export ANDROID_AVD_HOME=/home/gabriel/.android/avd/
export ANDROID_EMULATOR_HOME=//home/gabriel/.android/
export ANDROID_PATH=$ANDROID_SDK_ROOT:/tools/:$ANDROID_SDK_ROOT:/platform-tools/
export FLUTTER="$PATH:/home/gabriel/Flutter/Flutter 2.2.3/flutter/bin"

ok, you have android-30 == android 11
“Android Virtual Devices” is empty ! it’s at us to create one android emulator
can create with android-studio gui or

sdkmanager --install "system-images;android-30;default;x86"
avdmanager create avd -n flutter -k "system-images;android-30;default;x86"

where did you find your environment variables? (not in doc, not in aur packages…)
I have (as aur package) only for flutter:
FLUTTER_ROOT= and i repeat: not add $PATH in this variable !
if we not have chrome but chromium, add var CHROME_EXECUTABLE=chromium

no sens : you set 4 bad path, for set 2 path:
export ANDROID_PATH=$ANDROID_SDK_ROOT/tools/:$ANDROID_SDK_ROOT/platform-tools/

at you to verify after close/open terminal

env | grep -Ei "android|path|flutter"

Hello there, and thanks for your time.

I just restored my system and installed all again, and it is partially working now, except the avd emulator will always crash my system - it will start, than memory consuption will start growing larger, and larger till the system freezes completely

for the paths, i found this post on SO ( https://stackoverflow.com/questions/26483370/android-emulator-error-message-panic-missing-emulator-engine-program-for-x86/49511666 ) where someone advised to write this in bashrc:

export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH=$ANDROID_SDK/emulator:$PATH
export PATH=$ANDROID_SDK/tools:$PATH
export PATH=$ANDROID_SDK/tools/bin:$PATH
export PATH=$ANDROID_SDK/platform-tools:$PATH
export ANDROID_AVD_HOME=$HOME/.android/and
alias emulator='$ANDROID_SDK/emulator/emulator'

i did, and it is working… dont know if all lines are essential

Hey guys, as my problem with the paths are over and the avd issues are another subject, im going to mark as solved. thansk!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.