8

I have a problem with running my Flutter app on Android emulator using Genymotion.

After launch emulator, I have tried to "flutter run", but it didn't work. Console shows "No connected devices."

So how can I connect flutter with Genymotion? Could you tell me something? https://gyazo.com/7d75068683c043922c5fff75377e9817 https://gyazo.com/c9ccae04ffdfba3fa66fa6ff7e038e8f

The reason why I want to use Genymotion is Android Studio is too heavy.

But I wonder Flutter doesn't work on Genymotion without Android Studio.

Torhonye
  • 81
  • 1
  • 1
  • 2
  • what do you see if you run `adb devices` command? empty list too? – pskink Feb 22 '19 at 11:15
  • or `flutter devices` command – pskink Feb 22 '19 at 11:26
  • does `adb devices` show anything? what do you see if you run `adb devices` command? empty list too? – pskink Feb 22 '19 at 11:48
  • Flutter doesn't work because android sdkmanager not found. https://gyazo.com/3cb5cd9e52422467deda8a9af4f10b79 Does it mean I have to set `flutter config --android-sdk` to platform-tools ? – Torhonye Feb 22 '19 at 11:51
  • ok, what do you see if you run `flutter -v doctor`? what do you have marked in red color? – pskink Feb 22 '19 at 11:52
  • I don't know the distinction between "android-sdk", "platform-tools", and "tools" which can be downloaded on this site. https://developer.android.com/studio/releases/sdk-tools – Torhonye Feb 22 '19 at 11:54
  • No valid Android SDK platforms found in /usr/local/Caskroom/android-platform-tools/28.0.1/platforms. Directory was empty. – Torhonye Feb 22 '19 at 11:55
  • That is the message only shown red. The others are all green. – Torhonye Feb 22 '19 at 11:55
  • did you follow https://flutter.io/docs/get-started/install/linux? – pskink Feb 22 '19 at 11:56
  • also see [Note:](https://flutter.io/docs/get-started/install/linux#android-setup) – pskink Feb 22 '19 at 11:58
  • My Android Studio is also missing the location of android-sdk. Do I have to download SDK(https://developer.android.com/studio/index.html#downloads) and change `ANDROID_HOME` to the place of that? – Torhonye Feb 22 '19 at 12:13
  • if you have already installed Android Studio why would want to download it again? simply use [SDK Manager](https://developer.android.com/studio/intro/update#sdk-manager) to install the components you need – pskink Feb 22 '19 at 12:18
  • Finally, I have solved my problem! Thank you so much!! – Torhonye Feb 22 '19 at 13:49

4 Answers4

12
  1. Install the Genymotion plug-in for Android Studio (Within AS: Tools > SDK Manager > Plugins > Genymotion). Restart AS

  2. Configure the SDK within Genymotion (Genymotion > Preferences > ADB > Use custom Android SDK tools) then use the path /Users/{Your user}/Library/Android/sdk (default location after installing AS)

  3. Create a new device within Genymotion

  4. Configure correct Genymotion path within AS:

    a. View > Toolbars (to display the Genymotion icon if not default appearing)

    b. Press the Genymotion icon in the toolbar (appears next to magnifying glass at the right hand side)

    c. Point the path to the Genymotion folder location (eg: /Applications/Genymotion)

    d. Close the box

Now you are set up, so in future press the icon, select your emulator and run to launch within Android Studio. This will be detected by flutter when trying run apps using flutter run command.

SenAnan
  • 276
  • 4
  • 10
2

First Start the Genymotion emulator which you already downloaded an image and installed.

When emulator status is ON the open a command and run the following command:

flutter devices

If you see the installed image on output then like below then everything is fine:

PS F:\osx> flutter devices

1 connected device:

Samsung Galaxy S9 • 192.168.150.101:5555 • android-x86 • Android 8.0.0 (API 26)

Simply select the device on VScode or Android Studio and hit the run.

Community
  • 1
  • 1
Payam Khaninejad
  • 7,692
  • 6
  • 45
  • 55
1
1) Install genymotion correctly. you can see here: [https://www.genymotion.com/plugins/][1]
  1. install the Genymotion plugin for Android Studio
2-1) In Android Studio, go to File/Settings (for Windows and Linux) or to Android Studio/Preferences (for Mac OS X)
2-2) Select Plugins and click Browse Repositories.

2-3) Right-click on Genymotion and click Download and install.

This is what you need to do if the genymotion icon don't apper.

2-4) To see Genymotion plugin icon, display the toolbar by clicking View > Toolbar.

After the last step, I can see the icon now and run my app with genymotion.

I hope this helps your problem, since after struggling to find it works for me

Don
  • 15
  • 6
M E S A B O
  • 783
  • 1
  • 11
  • 15
0

execute:

flutter run --enable-software-rendering

from Run/Edit configurations menu in IDE

source: https://github.com/flutter/flutter/issues/11094#issuecomment-372662053

Wilmer
  • 482
  • 8
  • 11