Jack J
Jack J

Reputation: 199

Dart in Android Studio. No device to run applicaton

I can't run application because there is no devices on the list. I tried to create AVD and connect real device. I have installed curl, Android SDK path was set, flutter licenses were accepted. I have Ubuntu 16.04.4

Output of flutter run --verbose in projects directory :

 flutter: command not found

I have flutter path:

$ export PATH=/home/joe/flutter/bin:$PATH
$ echo $PATH
/home/joe/flutter/bin:home/joe/flutter/bin:home/joe/flutter/bin:/home/joe/bin:/home/joe/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Now I put path's to .bashrc and run source ~/.bashrc, did I put path's correct way ?

# set PATH so it includes user's private bin directories

    export PATH=/home/joe/flutter/bin:$PATH
    export ANDROID_HOME=$HOME/Android/SDK
    export PATH=$PATH:$ANDROID_HOME/tools

After adding path's to .bashrc I run flutter doctor:

$ /home/joe/flutter/bin/flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel master, v0.5.7-pre.102, on Linux, locale en_US.UTF-8)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information
      On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
      On Fedora: dnf install libstdc++.i686
      On Arch: pacman -S lib32-libstdc++5

[✗] 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.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
[✓] Android Studio (version 3.1)
[!] IntelliJ IDEA Community Edition (version 2018.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
[!] Connected devices
    ! No devices available

! Doctor found issues in 4 categories.

Upvotes: 2

Views: 1607

Answers (2)

Gagan Raghunath
Gagan Raghunath

Reputation: 1733

Can be easily fixed by setting project SDK to latest Android API.

  1. Go to File
  2. Project Structure
  3. Under Project-SDK select the latest SDK installed(Example:- Android API 29 Platform).

Upvotes: 1

Sunil
Sunil

Reputation: 3494

You have to set an Environment variable.

You can check it here for Flutter SDK setup with Android Studio

Upvotes: 0

Related Questions