flutterpi_tool icon indicating copy to clipboard operation
flutterpi_tool copied to clipboard

flutterpi_tool installation problem

Open quanggdungg0609 opened this issue 2 years ago • 10 comments

when i used "flutter pub global activate flutterpi_tool" i received a message like this:

Note: file is pinned to version 7.0.0 by flutter_tools from the flutter SDK. See https://dart.dev/go/sdk-version-pinning for details.

Note: process is pinned to version 5.0.2 by flutter_tools from the flutter SDK.

See https://dart.dev/go/sdk-version-pinning for details.

Because flutterpi_tool <0.2.0 depends on file ^6.1.4 and every version of flutter_tools from sdk depends on file 7.0.0, flutterpi_tool <0.2.0 is incompatible with flutter_tools from sdk. And because every version of flutterpi_tool depends on flutter_tools from sdk and flutterpi_tool >=0.2.0 depends on process ^4.2.4, every version of flutterpi_tool requires process ^4.2.4. Because every version of flutterpi_tool depends on flutter_tools from sdk which depends on process 5.0.2, every version of flutterpi_tool requires process 5.0.2. Thus, flutterpi_tool is forbidden. So, because pub global activate depends on flutterpi_tool any, version solving failed.

quanggdungg0609 avatar Jan 14 '24 09:01 quanggdungg0609

Seems like you're on flutter beta? Or master? Flutter stable is still using file 6.1.4: https://github.com/flutter/flutter/blob/stable/packages/flutter_tools/pubspec.yaml#L18

flutterpi_tool is only supported for flutter stable

ardera avatar Jan 14 '24 19:01 ardera

thank you for the help, i installed the flutterpi_tool but i have errors when following the README.md to build a exemple app. I have searched all topics in the Issues section but have not found an answer. Here is the error: Screenshot 2024-01-14 at 23 26 54

quanggdungg0609 avatar Jan 14 '24 22:01 quanggdungg0609

I saw your message on discord and replied to you there 😄 just adding it here for completeness:

Hey, currently linux arm64 is not supported as a host platform. Though, I see you're running parallels; you can try running on macos natively, macOS arm64 (apple silicon) is supported as a host platform

ardera avatar Jan 15 '24 12:01 ardera

Unfortunately when I do as you said, I get the message as shown in the picture but with flutterpi_gen_snapshot_macos_darwin64_generic_release 🥲. And when I run it again on the 2nd try I get this message Screenshot 2024-01-17 at 18 51 45 ... and a series of errors after that but my terminal did not display all of them to capture them

quanggdungg0609 avatar Jan 17 '24 17:01 quanggdungg0609

Can you try running flutter pub global activate flutterpi_tool again, and then rerunning the build?

If the error remains, the complete commandline output would be great, either copy & paste the output, or redirect the output to a file and attach that, etc. Thanks!

ardera avatar Jan 17 '24 18:01 ardera

I also encountered the same situation, how should I deal with it?

IceIce1030 avatar Feb 06 '24 03:02 IceIce1030

@IceIce1030 if you have a similar problem, please also post the complete output.

ardera avatar Jun 04 '24 13:06 ardera

Having a similar issue here are some details: OS: Ubuntu 22.04 flutterpi_tool: Using latest commit on main branch Activated with dart pub global activate --source path ~/Development/flutterpi_tool (I tried with pub as well same problem)

I first ran flutterpi_tool precache, here is the full output:

flutterpi_tool precache output
  $ flutterpi_tool precache
  Downloading engine-dbgsyms-armv7-generic-debug_unopt.tar.xz...         5.7s
  Downloading engine-dbgsyms-armv7-generic-debug.tar.xz...            5.2s
  Downloading engine-dbgsyms-armv7-generic-profile.tar.xz...          5.5s
  Downloading engine-dbgsyms-armv7-generic-release.tar.xz...          5.1s
  Downloading engine-aarch64-generic-debug_unopt.tar.xz...         2,720ms
  Downloading engine-dbgsyms-aarch64-generic-debug_unopt.tar.xz...        24.1s
  Downloading engine-dbgsyms-aarch64-generic-debug.tar.xz...          5.4s
  Downloading engine-dbgsyms-aarch64-generic-profile.tar.xz...        13.4s
  Downloading engine-dbgsyms-aarch64-generic-release.tar.xz...         7.5s
  Downloading engine-x64-generic-debug_unopt.tar.xz...                3.1s
  Downloading engine-dbgsyms-x64-generic-debug_unopt.tar.xz...         9.1s
  Downloading engine-dbgsyms-x64-generic-debug.tar.xz...              4.9s
  Downloading engine-dbgsyms-x64-generic-profile.tar.xz...            4.0s
  Downloading engine-dbgsyms-x64-generic-release.tar.xz...            5.2s
  Downloading engine-pi3-profile.tar.xz...                         1,907ms
  Downloading engine-dbgsyms-pi3-profile.tar.xz...                    4.9s
  Downloading engine-dbgsyms-pi3-release.tar.xz...                    5.1s
  Downloading engine-pi3-64-profile.tar.xz...                         6.4s
  Downloading engine-dbgsyms-pi3-64-profile.tar.xz...                 6.0s
  Downloading engine-pi3-64-release.tar.xz...                      2,214ms
  Downloading engine-dbgsyms-pi3-64-release.tar.xz...                 5.0s
  Downloading engine-pi4-profile.tar.xz...                         2,128ms
  Downloading engine-dbgsyms-pi4-profile.tar.xz...                    5.2s
  Downloading engine-pi4-release.tar.xz...                         2,519ms
  Downloading engine-dbgsyms-pi4-release.tar.xz...                    7.3s
  Downloading engine-pi4-64-profile.tar.xz...                         7.8s
  Downloading engine-dbgsyms-pi4-64-profile.tar.xz...                 4.7s
  Downloading engine-pi4-64-release.tar.xz...                      1,838ms
  Downloading engine-dbgsyms-pi4-64-release.tar.xz...                 4.7s

Then when running flutterpi_tool build --arch=arm64 --release

flutterpi_tool build --arch=arm64 --release output
  $ flutterpi_tool build --arch=arm64 --release
  Target copy_flutterpi failed: PathNotFoundException: Cannot open file, path = '/home/werner/Development/flutter_sdk/flutter/bin/cache/artifacts/flutter-pi/aarch64-linux-gnu/release/flutter-pi' (OS Error: No such file or directory, errno = 2)
  #0      _File.throwIfError (dart:io/file_impl.dart:675:7)
  #1      _File.openSync (dart:io/file_impl.dart:490:5)
  #2      ForwardingFile.openSync (package:file/src/forwarding/forwarding_file.dart:74:16)
  #3      ErrorHandlingFile.copySync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:311:22)
  #4      _runSync (package:flutter_tools/src/base/error_handling_io.dart:587:14)
  #5      ErrorHandlingFile.copySync (package:flutter_tools/src/base/error_handling_io.dart:310:5)
  #6      CopyFlutterpiBinary.build (package:flutterpi_tool/src/build_system/targets.dart:145:10)
  #7      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:27)
  <asynchronous suspension>
  #8      Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
  <asynchronous suspension>
  #9      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
  <asynchronous suspension>
  #10     FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:642:16)
  <asynchronous suspension>
  #11     buildFlutterpiBundle (package:flutterpi_tool/src/build_system/build_app.dart:155:20)
  <asynchronous suspension>
  #12     BuildCommand.runCommand (package:flutterpi_tool/src/cli/commands/build.dart:154:7)
  <asynchronous suspension>
  #13     FlutterpiCommandMixin.run.<anonymous closure> (package:flutterpi_tool/src/cli/flutterpi_command.dart:402:24)
  <asynchronous suspension>
  #14     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
  <asynchronous suspension>
  #15     FlutterpiCommandMixin.run (package:flutterpi_tool/src/cli/flutterpi_command.dart:400:12)
  <asynchronous suspension>
  #16     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
  <asynchronous suspension>
  #17     main (package:flutterpi_tool/src/executable.dart:37:5)
  <asynchronous suspension>
  #18     main (file:///home/werner/Development/flutterpi_tool/bin/flutterpi_tool.dart:4:3)
  <asynchronous suspension>
  
  Building Flutter-Pi bundle...                                           
  Failed to build Flutter-Pi bundle: Error: Failed to build bundle.
  #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
  #1      buildFlutterpiBundle (package:flutterpi_tool/src/build_system/build_app.dart:164:7)
  <asynchronous suspension>
  #2      BuildCommand.runCommand (package:flutterpi_tool/src/cli/commands/build.dart:154:7)
  <asynchronous suspension>
  #3      FlutterpiCommandMixin.run.<anonymous closure> (package:flutterpi_tool/src/cli/flutterpi_command.dart:402:24)
  <asynchronous suspension>
  #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
  <asynchronous suspension>
  #5      FlutterpiCommandMixin.run (package:flutterpi_tool/src/cli/flutterpi_command.dart:400:12)
  <asynchronous suspension>
  #6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
  <asynchronous suspension>
  #7      main (package:flutterpi_tool/src/executable.dart:37:5)
  <asynchronous suspension>
  #8      main (file:///home/werner/Development/flutterpi_tool/bin/flutterpi_tool.dart:4:3)
  <asynchronous suspension>

I checked the flutter/bin/cache/artifacts/flutter-pi/ directory and the folders are present but the binaries are not, so I downloaded and extracted them manually which seems to fix the problem.

Here is my flutter doctor output.

flutter doctor -v output

$ flutter doctor -v [✓] Flutter (Channel stable, 3.22.2, on Ubuntu 22.04.4 LTS 6.5.0-35-generic, locale en_ZA.UTF-8) • Flutter version 3.22.2 on channel stable at /home/werner/Development/flutter_sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 761747bfc5 (13 days ago), 2024-06-05 22:15:13 +0200 • Engine revision edd8546116 • Dart version 3.4.3 • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc4) • Android SDK at /home/werner/Android/Sdk • Platform android-34, build-tools 35.0.0-rc4 • Java binary at: /snap/android-studio/157/jbr/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted.

[✓] Chrome - develop for the web • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop • Ubuntu clang version 14.0.0-1ubuntu1.1 • cmake version 3.22.1 • ninja version 1.11.1 • pkg-config version 0.29.2

[✓] Android Studio (version 2023.3) • Android Studio at /snap/android-studio/157 • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.89.0) • VS Code at /usr/share/code • Flutter extension version 3.90.0

[✓] Connected device (6 available) • Linux (desktop) • linux • linux-x64 • Ubuntu 22.04.4 LTS 6.5.0-35-generic • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.61 • TI EV Board Debug OpenGL (mobile) • ti-opengl • linux-arm64 • Texas Instruments AM62XX • TI EV Board Profile OpenGL (mobile) • ti-opengl-profile • linux-arm64 • Texas Instruments AM62XX • TI EV Board Debug (mobile) • ti-debug • linux-arm64 • Texas Instruments AM62XX • TI EV Board Profile (mobile) • ti-profile • linux-arm64 • Texas Instruments AM62XX

[✓] Network resources • All expected network resources are available.

• No issues found!

werner-scholtz avatar Jun 18 '24 13:06 werner-scholtz

@werner-scholtz fixed in af8b5f98ee6c23936b2907bf739f6fa1a738ba14 and 780bd021fb252cfbeb2c1b68a40416b5cdf53f6a

Can you try removing bin/cache/flutter-pi.stamp and bin/cache/artifacts/flutter-pi and try again?

ardera avatar Jun 19 '24 17:06 ardera

Hi, seems to be working now with the latest release (0.5.0).

werner-scholtz avatar Jun 28 '24 09:06 werner-scholtz