babariviere / flutter-nix-hello-world

Demonstration on how to use flutter with Nix
52 stars 10 forks source link

Can we provision android stuff as well? #1

Closed jmackie closed 4 years ago

jmackie commented 4 years ago

I'm on NixOS and have never used Android anything before. It would be nice if this provisioned the necessary android stuff and Just Worked™. Or included instructions in the README to get all that stuff set up.

Running flutter build apk fails for me fails with the following flutter_01.log


Flutter crash report; please file at https://github.com/flutter/flutter/issues.

command

flutter --no-version-check build apk

exception

NoSuchMethodError: NoSuchMethodError: The method 'reinitialize' was called on null. Receiver: null Tried calling: reinitialize()

#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1      _AndroidBuilderImpl.buildApk (package:flutter_tools/src/android/android_builder.dart:105:18)
<asynchronous suspension>
#2      BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:106:26)
#3      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:615:18)
#4      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#5      _rootRunUnary (dart:async/zone.dart:1134:38)
#6      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#7      _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#8      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#9      Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#10     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#11     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
#12     _rootRun (dart:async/zone.dart:1126:13)
#13     _CustomZone.run (dart:async/zone.dart:1023:19)
#14     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#15     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#16     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#17     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#18     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#19     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)

flutter doctor

[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Linux, locale en_GB.UTF-8)
    • Flutter version 1.12.13+hotfix.5 at /nix/store/ibphbnn5z5vnhvh90v2qvh69aqq2y1ax-flutter-stable-1.12.13+hotfix.5-unwrapped
    • Framework revision 27321ebbad (4 weeks ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

[✗] 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.dev/setup/#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.

[!] Android Studio (version 3.5)
    • Android Studio at /nix/store/qj1v3bxxpx76p4q9d9z50pa18xzkp42w-android-studio-stable-3.5.3.0-unwrapped
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

(Looks like I have android-studio installed somewhere - either via systemPackages or nix-env - but clearly that's not enough)

babariviere commented 4 years ago

Oh yes of course ! I hadn't though about that.

I will add it !

babariviere commented 4 years ago

It should work now :smile: