screenshots icon indicating copy to clipboard operation
screenshots copied to clipboard

flutter pub get fails in Flutter 1.22.0-12.1.pre • channel beta

Open kauaicreative opened this issue 5 years ago • 17 comments

flutter pub get fails after upgrading Flutter to latest beta version - Flutter 1.22.0-12.1.pre • channel beta

[station6_04] flutter pub get
Running "flutter pub get" in station6_04...                     
Because screenshots >=1.0.0 depends on process ^3.0.9 and every version of flutter_driver from sdk depends on process 4.0.0-nullsafety.1, screenshots >=1.0.0 is incompatible with flutter_driver from sdk.

So, because station6 depends on both flutter_driver any from sdk and screenshots ^2.1.1, version solving failed.
pub get failed (1; So, because station6 depends on both flutter_driver any from sdk and screenshots ^2.1.1, version solving failed.)

kauaicreative avatar Sep 18 '20 13:09 kauaicreative

Current workaround by overriding the following:

EDIT: This really isn't a workaround and heavily depends on what other packages you have installed. Overrides are hacky fixes and should be avoided.

dependency_overrides:
  process: ^4.0.0-nullsafety.1
  platform: ^3.0.0-nullsafety.1
  file: ^6.0.0-nullsafety.1

danielmahon avatar Sep 22 '20 14:09 danielmahon

This now also occurs with the latest stable Flutter - 1.22

vHanda avatar Oct 02 '20 14:10 vHanda

@danielmahon Your workaround works on pub get but when I run my test I have those errors (No such file or directory) :

~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/file_system.dart:8:8: Error: Error when reading '~/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.0.0-nullsafety.1/lib/record_replay.dart': No such file or directory
import 'package:file/record_replay.dart';
       ^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/process_manager.dart:8:8: Error: Error when reading '~/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.0.0-nullsafety.1/lib/record_replay.dart': No such file or directory
import 'package:process/record_replay.dart';
       ^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/file_system.dart:34:1: Error: Type 'RecordingFileSystem' not found.
RecordingFileSystem getRecordingFileSystem(String location) {
^^^^^^^^^^^^^^^^^^^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/file_system.dart:50:1: Error: Type 'ReplayFileSystem' not found.
ReplayFileSystem getReplayFileSystem(String location) {
^^^^^^^^^^^^^^^^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/process_manager.dart:28:1: Error: Type 'RecordingProcessManager' not found.
RecordingProcessManager getRecordingProcessManager(String location) {
^^^^^^^^^^^^^^^^^^^^^^^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/process_manager.dart:44:8: Error: Type 'ReplayProcessManager' not found.
Future<ReplayProcessManager> getReplayProcessManager(String location) async {
       ^^^^^^^^^^^^^^^^^^^^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/file_system.dart:36:9: Error: 'RecordingFileSystem' isn't a type.
  final RecordingFileSystem fileSystem = RecordingFileSystem(
        ^^^^^^^^^^^^^^^^^^^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/file_system.dart:36:42: Error: Method not found: 'RecordingFileSystem'.
  final RecordingFileSystem fileSystem = RecordingFileSystem(
                                         ^^^^^^^^^^^^^^^^^^^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/file_system.dart:52:10: Error: Method not found: 'ReplayFileSystem'.
  return ReplayFileSystem(recording: dir);
         ^^^^^^^^^^^^^^^^
~/flutter/.pub-cache/hosted/pub.dartlang.org/tool_base-1.9.5+3/lib/src/base/process_manager.dart:31:9: Error: 'RecordingProcessManager' isn't a type.
  final RecordingProcessManager manager = RecordingProcessManager(delegate, dir);

I found file_system.dart and fake_process_manager.dart at these locations, and not a single occurrence of record_replay.dart on my disk :

~/flutter/packages/flutter_tools/lib/src/base/file_system.dart

~/flutter/packages/flutter_tools/test/src/fake_process_manager.dart
~/flutter/dev/bots/test/fake_process_manager.dart

nicolasvergoz avatar Oct 04 '20 13:10 nicolasvergoz

@nicolasvergoz yeah, unfortunately, I have no idea, those classes probably don't exist in the specific dependency tree you are overriding... overrides are messy and should not be used if it can be helped as they can break all sorts of things, I just posted that because it solved the issue at the time, I have since disabled this package until I need it again or it's updated

danielmahon avatar Oct 05 '20 23:10 danielmahon

@danielmahon Alright thanks. So the only solution for now is to downgrade Flutter to 1.21 I guess ?

nicolasvergoz avatar Oct 06 '20 06:10 nicolasvergoz

Unfortunately, this lib is not well-maintained :(

agordeev avatar Oct 06 '20 09:10 agordeev

Is out there any alternative project?

xalikoutis avatar Oct 06 '20 15:10 xalikoutis

https://github.com/mmcc007/screenshots/issues/214 This post might be interesting. Having a screenshot-cli in one hand and a lightweight screenshot as flutter package in another. Could this idea solve the dependance issue ?

nicolasvergoz avatar Oct 06 '20 15:10 nicolasvergoz

@mmcc007 Could you support us in updating the pubspec libraries?

amorenew avatar Oct 07 '20 04:10 amorenew

I have a PR open that I think will help: https://github.com/mmcc007/tool_base/pull/2. @mmcc007 hasn't responded yet, but they are occasionally active on github so maybe there's a chance. =)

Assuming we can get PRs reviewed I think making screenshots compatible with flutter 1.2.2 should be doable. Probably a few more small PRs to get it done, but no heavy lifting.

speaking-in-code avatar Oct 07 '20 04:10 speaking-in-code

I've made a few pull-request to fix this: #217, mmcc007/tool_mobile#1, mmcc007/tool_base_test#1, mmcc007/tool_base#2 and mmcc007/fake_process_manager#1. It depends on the PR from @speaking-in-code too.

If you want to use this locally you can put this in your pubspec.yaml:

dependency_overrides:
  screenshots:
    git: https://github.com/trygvis/screenshots
  tool_base:
    git: https://github.com/speaking-in-code/tool_base
  tool_base_test:
    git: https://github.com/trygvis/tool_base_test
  tool_mobile:
    git: https://github.com/trygvis/tool_mobile
  fake_process_manager:
    git: https://github.com/trygvis/fake_process_manager

Works on my machine at least!

trygvis avatar Oct 15 '20 11:10 trygvis

Please release an update regarding this issue.

Carlit0 avatar Nov 02 '20 01:11 Carlit0

I can't get it to work on MacOS using any of the two workarounds above, when running flutter pub global activate screenshots I get this, almost feels like there is some windows directory hardcoded in there somewhere?

recompiling executables... Failed to precompile screenshots:main: C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:3:8: Error: Error when reading 'C%3A/src/flutter/.pub-cache/bin/global_packages/screenshots/C:/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/args-1.6.0/lib/args.dart': No such file or directory import 'package:args/args.dart'; ^ C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:4:8: Error: Error when reading 'C%3A/src/flutter/.pub-cache/bin/global_packages/screenshots/C:/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/lib/screenshots.dart': No such file or directory import 'package:screenshots/screenshots.dart'; ^ Error: Cannot run with sound null safety, because the following dependencies don't support null safety:

  • package:args
  • package:screenshots

For solutions, see https://dart.dev/go/unsound-null-safety C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:134:19: Error: Type 'ArgParser' not found. void _handleError(ArgParser argParser, String msg) { ^^^^^^^^^ C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:139:17: Error: Type 'ArgParser' not found. void _showUsage(ArgParser argParser) { ^^^^^^^^^ C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:11:3: Error: 'ArgResults' isn't a type. ArgResults argResults; ^^^^^^^^^^ C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:19:9: Error: 'ArgParser' isn't a type. final ArgParser argParser = ArgParser(allowTrailingOptions: false) ^^^^^^^^^ C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:19:31: Error: Method not found: 'ArgParser'. final ArgParser argParser = ArgParser(allowTrailingOptions: false) ^^^^^^^^^ C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:22:21: Error: Getter not found: 'kConfigFileName'. defaultsTo: kConfigFileName, ^^^^^^^^^^^^^^^ C%3A/src/flutter/.pub-cache/bin/hosted/pub.dartlang.org/screenshots-2.1.1/bin/main.dart:24:20: Error: Getter not found: 'kConfigFileName'. valueHelp: kConfigFileName)

marcschw avatar Dec 08 '20 14:12 marcschw

ok nevermind I just forgot to restart the terminal window after changing the path variable...

marcschw avatar Dec 08 '20 14:12 marcschw

Since this is still an issue, I am curious, when this will be fixed?

felixwortmann avatar Dec 19 '20 21:12 felixwortmann

I am also curious when the PRs are happening?

krjw-eyev avatar Feb 02 '21 16:02 krjw-eyev

I have this in my pubspec.yaml:

dev_dependencies:
  screenshots: any
  flutter_driver:
    sdk: flutter

dependency_overrides:
  screenshots:
    git: https://github.com/trygvis/screenshots
  tool_base:
    git: https://github.com/speaking-in-code/tool_base
  tool_base_test:
    git: https://github.com/trygvis/tool_base_test
  tool_mobile:
    git: https://github.com/trygvis/tool_mobile
  fake_process_manager:
    git: https://github.com/trygvis/fake_process_manager

But unfortunately getting the error:

Because every version of tool_base from git depends on archive ^2.0.9 and every version of flutter_driver from sdk depends on archive 3.1.2, tool_base from git is incompatible with flutter_driver from sdk.

flutter --version:

➜ flutter --version
Flutter 2.2.0-10.1.pre • channel dev • https://github.com/flutter/flutter.git
Framework • revision 0941968447 (9 days ago) • 2021-04-15 12:01:02 -0700
Engine • revision d2a2e93510
Tools • Dart 2.13.0 (build 2.13.0-211.6.beta)

maxisme avatar Apr 24 '21 13:04 maxisme