leancodepl / patrol

Flutter-first UI testing framework. Ready for action!
https://patrol.leancode.co
Apache License 2.0
902 stars 137 forks source link

Unable to update to latest version 1.1.3 #1143

Closed PeterBriggsGreggs closed 1 year ago

PeterBriggsGreggs commented 1 year ago

Hi, I tried running the patrol update command however the update process failed to download all the required artifacts. Message below are from the terminal in AS: peterbriggs@Peters-MacBook-Pro-2 gotg_apps_grecords % patrol update ✓ New patrol_cli version is available (1.1.3) (0.4s) ✓ Updated patrol_cli to version 1.1.3 (4.1s) ✗ Failed to download artifacts for version 1.1.3 (0.4s) Exception: Failed to download Artifact.archive(name: AutomatorServer-iphoneos-arm64, version: 1.1.3, ext: app) from https://github.com/leancodepl/patrol/releases/download/patrol_cli-v1.1.3/AutomatorServer-iphoneos-arm64-1.1.3.zip

0 ArtifactsRepository._downloadArtifact (package:patrol_cli/src/common/artifacts_repository.dart:295:7)

#1 Future.wait. (dart:async/future.dart:521:21) #2 ArtifactsRepository.downloadArtifacts (package:patrol_cli/src/common/artifacts_repository.dart:279:5) #3 UpdateCommand.run (package:patrol_cli/src/features/update/update_command.dart:76:7) #4 CommandRunner.runCommand (package:args/command_runner.dart:209:13) #5 PatrolCommandRunner.runCommand (package:patrol_cli/src/command_runner.dart:291:18) #6 PatrolCommandRunner.run (package:patrol_cli/src/command_runner.dart:235:18) #7 patrolCommandRunner (package:patrol_cli/src/command_runner.dart:52:14) #8 main (file:///Users/peterbriggs/.pub-cache/hosted/pub.dartlang.org/patrol_cli-0.8.2+1/bin/main.dart:6:20) When clicking on the link failing link, the following web page is displayed, with a Not Found message: ![image](https://user-images.githubusercontent.com/86053215/228551102-7d6effd3-f6a6-47bd-8264-7aac522d017f.png) Please can you investigate this issue. Thank you
bartekpacia commented 1 year ago

Hi @PeterBriggsGreggs, sorry for the problems. This issue was already mentioned here, and the solution mentioned there should work for you as well. Tell me if it helps!

PeterBriggsGreggs commented 1 year ago

Hi, No... following the suggestions made in the other issue didn't work. Deactivating and reactivating didn't install version 1.1.3 Below is a verbose flutter doctor which shows Dart version as 2.19.5 Any other suggestions most welcome.

image
bartekpacia commented 1 year ago

I think the cause is here: "Warning: dart on your path resolves to ...". So dart resolves to Dart 2.17, which is not supported by Patrol CLI, which requires at least Dart 2.18.

PS Next time, copy the text from terminal and paste it, instead of attaching a screenshot.

bartekpacia commented 1 year ago

Please also show output of patrol doctor.

PeterBriggsGreggs commented 1 year ago

Patrol Doctor details:

image
bartekpacia commented 1 year ago

You need Dart 2.18.

Please run dart --version and see that your version of Dart is probably older.

PeterBriggsGreggs commented 1 year ago

You're right it is... Why is there a difference and how do I resolve this ? Thanks

image
PeterBriggsGreggs commented 1 year ago

One other piece of information for you... We use fvm (Flutter version Management) and in the Dart set up in Android Studio the details below are set up. Will this have a bearing on using patrol ?

image
bartekpacia commented 1 year ago

flutter doctor output you shared hints at the problem:

Warning: dart on your path resolves to /us/local/Cellar/dart/2.17.5/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/peterbriggs/flutter. Consider adding
/Users/peterbriggs/flutter/bin to the front of your path.

That's because you actually have two darts installed on your PC. Flutter comes with its own Dart, so make sure to uninstall any Dart that is not from Flutter. Looks like you installed dart with Homebrew, so uninstall it: brew uninstall dart.

bartekpacia commented 1 year ago

That's because you actually have two darts installed on your PC. Flutter comes with its own Dart, so make sure to uninstall any Dart that is not from Flutter.

No, as long as dart in your IDE is the same as the dart command from your command-line.

Good decision with using fvm - I use it too. Just do fvm install <your_version> and fvm global <your_version> (e.g. fvm install stable and fvm global stable) and it will download and set up the newest Flutter and Dart.

PeterBriggsGreggs commented 1 year ago

I've uninstalled Dart. I've checked the dart version after the uninstall and it shows 2.19.5 I've run patrol update and received these messages below:

image
bartekpacia commented 1 year ago

Nice, now the last step is to install and compile patrol_cli again, because it was first compiled on an older Dart version and it can't work on a newer one.

dart pub global deactivate patrol_cli
dart pub global activate patrol_cli

If this works, please close the issue :)

PeterBriggsGreggs commented 1 year ago

Yes... that's worked. Thank you for your help and support

github-actions[bot] commented 12 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.