Hello anyone. I come back using NixOS after a year with my latest laptop.
I have questions about Flutter setup on NixOS. I want to get it easy without using Flakes or Nix dev-shell, and it can done in my any IDE / text editor setup (I install Android Studio, VS Code, and Neovim). How must I do to solve it? I get this error on execute flutter doctor -v
.
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.13.8, on NixOS 23.11 (Tapir) 6.1.87, locale en_US.UTF-8)
• Flutter version 3.13.8 on channel stable at /nix/store/xqnvplwa30md9503anpixix0zn57dv9k-flutter-3.13.8-unwrapped
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 6c4930c4ac (7 months ago), 2023-10-18 10:57:55 -0500
• Engine revision 767d8c75e8
• Dart version 3.1.4
• DevTools version 2.25.0
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /home/anifyuli/.android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /home/anifyuli/.android/sdk
• Java binary at: /run/current-system/sw/bin/java
• Java version OpenJDK Runtime Environment (build 19.0.2+7-nixos)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = google-chrome-stable
[✗] Linux toolchain - develop for Linux desktop
✗ clang++ is required for Linux development.
It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
✗ CMake is required for Linux development.
It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
✗ ninja is required for Linux development.
It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from
https://github.com/ninja-build/ninja/releases
✗ pkg-config is required for Linux development.
It is likely available from your distribution (e.g.: apt install pkg-config), or can be downloaded from
https://www.freedesktop.org/wiki/Software/pkg-config/
[!] Android Studio (version 2023.2)
• Android Studio at /nix/store/pc4fn8zl4336bdlagji24hpn8qs4n1c2-android-studio-stable-2023.2.1.25-unwrapped
• Flutter plugin version 79.0.1
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Failed to run Java: ProcessException: No such file or directory
Command: /nix/store/pc4fn8zl4336bdlagji24hpn8qs4n1c2-android-studio-stable-2023.2.1.25-unwrapped/jbr/bin/java -version
✗ Unable to determine bundled Java version.
• Try updating or re-installing Android Studio.
[☠] Connected device (the doctor check crashed)
✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this
issue at https://github.com/flutter/flutter/issues.
✗ Exception: Unable to run "adb", check your Android SDK installation and ANDROID_SDK_ROOT environment variable:
/home/anifyuli/.android/sdk/platform-tools/adb
• #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 AndroidDevices.pollingGetDevices (package:flutter_tools/src/android/android_device_discovery.dart:75:7)
<asynchronous suspension>
#2 PollingDeviceDiscovery._populateDevices (package:flutter_tools/src/device.dart:563:36)
<asynchronous suspension>
#3 Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
<asynchronous suspension>
#4 DeviceManager.refreshAllDevices (package:flutter_tools/src/device.dart:231:40)
<asynchronous suspension>
#5 DeviceValidator.validate (package:flutter_tools/src/doctor.dart:689:34)
<asynchronous suspension>
#6 Future.any.onValue (dart:async/future.dart:615:5)
<asynchronous suspension>
[✓] Network resources
• All expected network resources are available.
I install Flutter on my Home Manager like this :
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
flutter-unwrapped
];
I add Android SDK downloade from Android Studio and save it on $HOME/.android/sdk
. I still confused how to solve it
Thanks for your help and sorry My English