leanflutter / flutter_distributor

An all-in-one Flutter application packaging and distribution tool, providing you with a one-stop solution to meet various distribution needs.
https://distributor.leanflutter.dev/
MIT License
812 stars 114 forks source link

Error building dmg file #72

Closed nzkn closed 2 years ago

nzkn commented 2 years ago

I have an issue when trying to build dmg:

Package is installed globally: dart pub global activate flutter_distributor as well as locally in pubspec.yaml: flutter_distributor: 0.0.6

There is distribute_options.yaml in the root of project: https://gist.github.com/nzkn/7aeb5090d035b9424537265b1f90997c

And there is also make config in macos/packaging/dmg/make_config.yaml: https://gist.github.com/nzkn/392e5eefc9346123d5fe68609bc9594f

The build is triggered with the following command, which I run from the project root: flutter_distributor release --name sand --jobs macos-dmg

I am getting following issue when trying to build .dmg file:

Successfully builded Directory: 'build/macos/Build/Products/Release'
Unhandled exception:
ProcessException: No such file or directory
  Command: appdmg dist/1.4.7/velocityOS-1.4.7+1.4.7-macos_dmg/make_config.json dist/1.4.7/velocityOS-1.4.7+1.4.7-macos.dmg
#0      _ProcessImpl._start (dart:io-patch/process_patch.dart:401:33)
#1      Process.start (dart:io-patch/process_patch.dart:38:20)
#2      AppPackageMakerDmg.make (package:app_package_maker_dmg/src/app_package_maker_dmg.dart:65:38)
<asynchronous suspension>
#3      FlutterAppPackager.package (package:flutter_app_packager/src/flutter_app_packager.dart:40:12)
<asynchronous suspension>
#4      FlutterDistributor.package (package:flutter_distributor/src/flutter_distributor.dart:173:35)
<asynchronous suspension>
#5      FlutterDistributor.release (package:flutter_distributor/src/flutter_distributor.dart:309:43)
<asynchronous suspension>
#6      CommandRelease.run (file:///Users/nkahaniak/.pub-cache/hosted/pub.dartlang.org/flutter_distributor-0.2.2/bin/command_release.dart:33:5)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#8      main (file:///Users/nkahaniak/.pub-cache/hosted/pub.dartlang.org/flutter_distributor-0.2.2/bin/main.dart:38:3)
<asynchronous suspension>

After the command execution fails I can see the following content of the dist folder:

Screenshot 2022-05-20 at 20 28 19

Am I doing anything wrong?

nzkn commented 2 years ago

Also another important note:

  1. I have appdmg installed globally
  2. When I run the same appdmg dist/1.4.7/velocityOS-1.4.7+1.4.7-macos_dmg/make_config.json dist/1.4.7/velocityOS-1.4.7+1.4.7-macos.dmg command manually from the project root .dmg is created successfully. It seems like this issue only occurs when the command is executed by dart
lijy91 commented 2 years ago

Please do not depend on flutter_distributor in your project, it needs to be installed globally. Please provide the information of flutter doctor

nzkn commented 2 years ago

% flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
[✓] VS Code (version 1.65.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

I tried to remove project flutter_distributor dependency and run without it, still the same result

[Edit]: Let me know if you need any extra information from me, please

lijy91 commented 2 years ago

This should be caused by the absence of the appdmg command, please install it according to the documentation.

https://distributor.leanflutter.org/docs/makers/dmg

npm install -g appdmg