Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kauaicreative opened this issue Sep 18, 2020 · 17 comments
Open

Comments

@kauaicreative
Copy link

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.)
@danielmahon
Copy link

danielmahon commented Sep 22, 2020

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

@vHanda
Copy link

vHanda commented Oct 2, 2020

This now also occurs with the latest stable Flutter - 1.22

@nicolasvergoz
Copy link

nicolasvergoz commented Oct 4, 2020

@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

@danielmahon
Copy link

@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

@nicolasvergoz
Copy link

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

@agordeev
Copy link

agordeev commented Oct 6, 2020

Unfortunately, this lib is not well-maintained :(

@xalikoutis
Copy link

xalikoutis commented Oct 6, 2020

Is out there any alternative project?

@nicolasvergoz
Copy link

#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 ?

@amorenew
Copy link

amorenew commented Oct 7, 2020

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

@speaking-in-code
Copy link

I have a PR open that I think will help: mmcc007/tool_base#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.

@trygvis
Copy link

trygvis commented Oct 15, 2020

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!

@Carlit0
Copy link

Carlit0 commented Nov 2, 2020

Please release an update regarding this issue.

hawkbee1 added a commit to hawkbee1/bluevsred that referenced this issue Nov 8, 2020
mmcc007/screenshots#215 (comment)

/home/hawkbee/snap/flutter/common/flutter/bin/flutter --no-color pub
outdated
Dependencies            Current                Upgradable
Resolvable             Latest
cupertino_icons         *1.0.0                 *1.0.0
*1.0.0                 1.0.1

dev_dependencies
screenshots             *2.1.1 (overridden)    *2.1.1 (overridden)
*2.1.1 (overridden)    2.1.1
test                    *1.16.0-nullsafety.5   *1.16.0-nullsafety.5
*1.16.0-nullsafety.5   1.16.0-nullsafety.9

transitive dependencies
async                   *2.5.0-nullsafety.1    *2.5.0-nullsafety.1
*2.5.0-nullsafety.1    2.5.0-nullsafety.3
characters              *1.1.0-nullsafety.3    *1.1.0-nullsafety.3
*1.1.0-nullsafety.3    1.1.0-nullsafety.5
charcode                *1.2.0-nullsafety.1    *1.2.0-nullsafety.1
*1.2.0-nullsafety.1    1.2.0-nullsafety.3
collection              *1.15.0-nullsafety.3   *1.15.0-nullsafety.3
*1.15.0-nullsafety.3   1.15.0-nullsafety.5
js                      *0.6.3-nullsafety.1    *0.6.3-nullsafety.1
*0.6.3-nullsafety.1    0.6.3-nullsafety.3
matcher                 *0.12.10-nullsafety.1  *0.12.10-nullsafety.1
*0.12.10-nullsafety.1  0.12.10-nullsafety.3
meta                    *1.3.0-nullsafety.4    *1.3.0-nullsafety.4
*1.3.0-nullsafety.4    1.3.0-nullsafety.6
path                    *1.8.0-nullsafety.1    *1.8.0-nullsafety.1
*1.8.0-nullsafety.1    1.8.0-nullsafety.3
pedantic                *1.10.0-nullsafety.2   *1.10.0-nullsafety.2
*1.10.0-nullsafety.2   1.10.0-nullsafety.3
source_span             *1.8.0-nullsafety.2    *1.8.0-nullsafety.2
*1.8.0-nullsafety.2    1.8.0-nullsafety.4
stack_trace             *1.10.0-nullsafety.2   *1.10.0-nullsafety.2
*1.10.0-nullsafety.2   1.10.0-nullsafety.6
string_scanner          *1.1.0-nullsafety.1    *1.1.0-nullsafety.1
*1.1.0-nullsafety.1    1.1.0-nullsafety.3
term_glyph              *1.2.0-nullsafety.1    *1.2.0-nullsafety.1
*1.2.0-nullsafety.1    1.2.0-nullsafety.3
typed_data              *1.3.0-nullsafety.3    *1.3.0-nullsafety.3
*1.3.0-nullsafety.3    1.3.0-nullsafety.5
vector_math             *2.1.0-nullsafety.3    *2.1.0-nullsafety.3
*2.1.0-nullsafety.3    2.1.0-nullsafety.5

transitive dev_dependencies
boolean_selector        *2.1.0-nullsafety.1    *2.1.0-nullsafety.1
*2.1.0-nullsafety.1    2.1.0-nullsafety.3
clock                   *1.1.0-nullsafety.1    *1.1.0-nullsafety.1
*1.1.0-nullsafety.1    1.1.0-nullsafety.3
fake_async              *1.2.0-nullsafety.1    *1.2.0-nullsafety.1
*1.2.0-nullsafety.1    1.2.0-nullsafety.3
file                    *6.0.0-nullsafety.2    *6.0.0-nullsafety.2
*6.0.0-nullsafety.2    6.0.0-nullsafety.4
platform                *3.0.0-nullsafety.2    *3.0.0-nullsafety.2
*3.0.0-nullsafety.2    3.0.0-nullsafety.4
pool                    *1.5.0-nullsafety.2    *1.5.0-nullsafety.2
*1.5.0-nullsafety.2    1.5.0-nullsafety.3
process                 *4.0.0-nullsafety.2    *4.0.0-nullsafety.2
*4.0.0-nullsafety.2    4.0.0-nullsafety.4
source_map_stack_trace  *2.1.0-nullsafety.3    *2.1.0-nullsafety.3
*2.1.0-nullsafety.3    2.1.0-nullsafety.4
source_maps             *0.10.10-nullsafety.2  *0.10.10-nullsafety.2
*0.10.10-nullsafety.2  0.10.10-nullsafety.3
stream_channel          *2.1.0-nullsafety.1    *2.1.0-nullsafety.1
*2.1.0-nullsafety.1    2.1.0-nullsafety.3
test_api                *0.2.19-nullsafety.2   *0.2.19-nullsafety.2
*0.2.19-nullsafety.2   0.2.19-nullsafety.6
test_core               *0.3.12-nullsafety.5   *0.3.12-nullsafety.5
*0.3.12-nullsafety.5   0.3.12-nullsafety.9
usage                   *3.4.1                 *3.4.1
*3.4.1                 3.4.2
vm_service_client       *0.2.6+2               *0.2.6+2
*0.2.6+2               0.2.6+3

Dependencies are all constrained to the latest resolvable versions.
Newer versions, while available, are not mutually compatible.
@marcschw
Copy link

marcschw commented Dec 8, 2020

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
Copy link

marcschw commented Dec 8, 2020

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

@felixwortmann
Copy link

felixwortmann commented Dec 19, 2020

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

@krjw-eyev
Copy link

I am also curious when the PRs are happening?

@maxisme
Copy link

maxisme commented Apr 24, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests