最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Setup - Flutter + Android Studio + WSL2 (ubuntu) - Stack Overflow

programmeradmin1浏览0评论

TLDR -> I need to find a way to install flutter, dart, android studio on a windows machine with WSL2

My setup

  • Windows 10
  • WSL2 with Ubuntu
  • VSCode installed on windows (connected to WSL)
  • Ruby and Ruby on rails installed on ubuntu

So my dev environment is used on ubuntu for now I would like to learn dart + flutter and use it on my ubuntu environement

Setup I want to add

  • dart + flutter installed on ubuntu
  • android studio installed on windows

WSL2 use the virtualization that's why I installed android studio on windows (emulators)

Problem

➜  ~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.5, on Ubuntu 22.04.5 LTS 5.15.167.4-microsoft-standard-WSL2, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ Android SDK file not found: adb.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.

➜  ~ adb devices
List of devices attached
127.0.0.1:5555  device
emulator-5554   device

➜  ~ flutter devices
Found 2 connected devices:
  Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.5 LTS 5.15.167.4-microsoft-standard-WSL2
  Chrome (web)    • chrome • web-javascript • Google Chrome 131.0.6778.85

adb launcher (adb.exe) can't be used in wsl so flutter devices can't detect my android studio emulator I tried many ways but impossible to find a way to develop my app on ubuntu and use my emulator from android studio on windows

Is there anybody with any tutorial to tell me if there is a way and how to setup dart, flutter, android studio and vscode on my machine ?

TLDR -> I need to find a way to install flutter, dart, android studio on a windows machine with WSL2

My setup

  • Windows 10
  • WSL2 with Ubuntu
  • VSCode installed on windows (connected to WSL)
  • Ruby and Ruby on rails installed on ubuntu

So my dev environment is used on ubuntu for now I would like to learn dart + flutter and use it on my ubuntu environement

Setup I want to add

  • dart + flutter installed on ubuntu
  • android studio installed on windows

WSL2 use the virtualization that's why I installed android studio on windows (emulators)

Problem

➜  ~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.5, on Ubuntu 22.04.5 LTS 5.15.167.4-microsoft-standard-WSL2, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ Android SDK file not found: adb.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.

➜  ~ adb devices
List of devices attached
127.0.0.1:5555  device
emulator-5554   device

➜  ~ flutter devices
Found 2 connected devices:
  Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.5 LTS 5.15.167.4-microsoft-standard-WSL2
  Chrome (web)    • chrome • web-javascript • Google Chrome 131.0.6778.85

adb launcher (adb.exe) can't be used in wsl so flutter devices can't detect my android studio emulator I tried many ways but impossible to find a way to develop my app on ubuntu and use my emulator from android studio on windows

Is there anybody with any tutorial to tell me if there is a way and how to setup dart, flutter, android studio and vscode on my machine ?

Share Improve this question asked Nov 28, 2024 at 10:10 Loris_RLoris_R 1931 silver badge6 bronze badges 5
  • 1 Why do you need wsl? All of these tools are available for ubuntu, I think you have to install android studio on wsl too. I'm not sure, I don't see why would one use a setup like this for flutter development. – Csaba Mihaly Commented Nov 28, 2024 at 10:30
  • @CsabaMihaly i tried to install android studio on wsl but wsl is already using the virtualization, so I can't use any emulator is this case – Loris_R Commented Nov 28, 2024 at 10:46
  • I'm thinking that i just need to install all my development setup on windows... (i would avoid it because i already have one on ubuntu for ruby etc...) – Loris_R Commented Nov 28, 2024 at 10:48
  • You should start the emulator on windows, on linux you need studio for the build. But you are just making your life harder, either go full Linux or windows, sure it's possible to use wsl. I just don't see why you want this. – Csaba Mihaly Commented Nov 28, 2024 at 11:05
  • @CsabaMihaly as I told, avoiding to have 2 development environments on my machine – Loris_R Commented Nov 28, 2024 at 11:58
Add a comment  | 

1 Answer 1

Reset to default 0

Just a clarification between Dart and Flutter, as you imply something about it, which seems to have needed some attention.

You do not need to install Dart separately as the Flutter SDK includes the full Dart SDK.

To learn more.

Additional tips: You can also use VS Code, but it is recommended to install Android Studio for some development reasons.

发布评论

评论列表(0)

  1. 暂无评论