The command flutter test -p chrome /path/to/my/test/file.dart unable to work. What parameters should I use?
[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [Version 10.0.17763.1817], locale zh-CN)
• Flutter version 2.0.3 at D:\SDK\Flutter
• Framework revision 4d7946a68d (13 days ago), 2021-03-18 17:24:33 -0700
• Engine revision 3459eb2436
• Dart version 2.12.2
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
Being a unit test you should not specify any platform. So the command should only be flutter test /path/to/my/test/file.dart
You only need to run on a specific platform in cases of integration tests.
If u using VScode Follow this steps
1.Step 1 area click anf then
2.Step 2 area Whatever device you want to choose
[][]
Related
I am new to flutter and Xcode, I got a new MacBook pro m1 max and I have a problem with my Xcode build when I try to launch my flutter application, flutter doctor gives me this error:
[!] Flutter (Channel stable, 3.3.8, on macOS 13.0.1 22A400 darwin-arm, locale en-FR)
• Flutter version 3.3.8 on channel stable at /Users/rixez/Developers/medissimo/mobil/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52b3dc25f6 (8 days ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
and when I try to launch the application here is the message.
2022-11-17 10:24:39.622 xcodebuild[5938:33408] apply_selection_policy_once: avoid use of removable GPUs (via com.apple.dt.xcodebuild:GPUSelectionPolicy->avoidRemovable)
Do you have an idea to get rid of this problem?
I tried to change the GPUSelectionPolicy->avoidRemovable but it didn't change anything
Please try installing Rosetta as described here:
https://github.com/flutter/flutter/wiki/Developing-with-Flutter-on-Apple-Silicon
I opened VSCode a few days ago to continue work on a Flutter project, unfortunately, the Flutter and Dart usually take a while to start(2-3 minutes), but this time,the extensions failed to initialize, and I'm left with white colourless code and no access to the tools that come with the extensions(i.e F5 for debug).screenshot of the current state of things
Over the past few days, I have,
Deleted and re-installed the Flutter SDK(forgive me, I cant remember what version it was at before, but now its 3.3.7, Dart 2.18.4)
Deleted and re-installed VSCode(used to be a snap, now a .deb)
Uninstalled and re-installed the Flutter and Dart extensions(multiple times, restarted VSCode each time)
- Ran said project directly from the terminal to be sure I had the flutter tool correctly installed(flutter run and flutter build apk ran fine, with no errors)
Please find the results of 'flutter doctor -v' below
Flutter (Channel stable, 3.3.7, on Ubuntu 20.04.5 LTS 5.15.0-52-generic,
locale en_NG)
• Flutter version 3.3.7 on channel stable at
/home/alabi/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e99c9c7cd9 (7 days ago), 2022-11-01 16:59:00 -0700
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[!] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
• Android SDK at /home/alabi/Android/Sdk
• Platform android-33, build-tools 32.1.0-rc1
• ANDROID_SDK_ROOT = /home/alabi/Android/Sdk
• Java binary at: /home/alabi/.jdks/openjdk-18.0.1.1/bin/java
• Java version OpenJDK Runtime Environment (build 18.0.1.1+2-6)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for
more details.
[✗] Chrome - develop for the web (Cannot find Chrome executable at
google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup
for detailed instructions).
[✓] VS Code (version 1.73.0)
• VS Code at /usr/share/code
• Flutter extension version 3.52.0
[✓] Connected device (1 available)
• Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.5 LTS 5.15.0-52-generic
The CLI command, 'flutter --version' returns
Flutter 3.3.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision e99c9c7cd9 (7 days ago) • 2022-11-01 16:59:00 -0700
Engine • revision 857bd6b74c
Tools • Dart 2.18.4 • DevTools 2.15.0
All of this leads me to believe the Flutter SDK is installed correctly and the problem is with VSCode and the extensions
Any help is appreciated, thank you!
Make sure that you use official extensions for Flutter/Dart. They are created by Dart Code.
Fixed!
If something in the extension is corrupt you could try uninstalling the extensions and then deleting them from ~/.vscode/extensions (the ones starting dart-code) and then reinstall.
From DartCode's GitHub, read the issue and fix here if you're still confused
I have made many flutter projects, but suddenly I am unable to create a project. I thought it was an issue with VSCode, so, I installed the latest version. Didn't work! Then I tried in Android Studio. It got stuck at 'Creating Flutter Project'. I even tried in CMD. It remains stuck at
Running "flutter pub get" in note ...
Got TLS error trying to find package cupertino_icons at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 1 in 1 second
This is flutter doctor -v
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18363.657], locale en-IN)
• Flutter version 1.17.5 at C:\flutter
• Framework revision 8af6b2f038 (13 days ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\nithi\AppData\Local\Android\sdk
• Platform android-30, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.47.0)
• VS Code at C:\Users\nithi\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.12.2
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
I looked into other answers.
Flutter SDK is stored at C:\flutter
I feel something is wrong with the SDK itself.
Can someone help me with this issue?
EDIT
This is flutter upgrade
Flutter is already up to date on channel stable
Flutter 1.17.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8af6b2f038 (13 days ago) • 2020-06-30 12:53:55 -0700
Engine • revision ee76268252
Tools • Dart 2.8.4
Apologies for the lateness in this.
If this is in a Corporate work environment, there may be a 'man in the middle' security scanning app that's preventing the project from being created.
I was using Flutter just fine until my company instituted 'Zscaler'. Since that got implemented, I'd also freeze at that same error message. I had to turn Zscaler off for my Flutter projects to create.
When I run the default test app on my devices all the console outputs is
Waiting for a connection from Flutter on SM N950F...
I thought the problem could be my physical device but I realized this isn't the case I tested it on two emulators and I get the same output.
When I run flutter doctor -v my output is:
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.959], locale en-ZA)
• Flutter version 1.17.5 at C:\src\flutter\flutter
• Framework revision 8af6b2f038 (3 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at C:\Users\Jimmy\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] Connected device (1 available)
• SM N950F • _myDeviceID_ • android-arm64 • Android 9 (API 28)
• No issues found!
Ok, so I've managed to figure something out.- I'll be answering my own question:
My current version of Android Studio (version 4.0.1) just doesn't want to run an app straight from the UI so you kinda have to brute force it from the terminal.
Make sure that your API level you're running your device on is the same as what you have installed on Android Studio.
1.1 Click on the SDK Manager button around the top right corner of AS (The icon is a box with a down arrow next to it)
1.2 Choose the same API level as your device, (When I didn't do this I had a partial install and it took some time to compile), then click apply and wait for it to install.
We're going to run the project to our avd or mobile device from the directory of ourproject.
2.1 Open up the Command Prompt (preferably as Admin), and chage the directoy to where your project is, the command should look something like this
cd Documents\AndroidStudioProjects\your_flutter_app_folder
2.2 Finally type the command flutter run it will take about 1 minute to compile, first time round.
I got a "Dart upgrade" in VS Code (win10)
right after when I try to create a new flutter web project
I got
Unable to execute Stagehand. Stagehand exited with code 65. stagehand 3.3.2 doesn't support Dart 2.3.1.
given that I didn't have this problem before,
I'm assuming that it's caused by the update.
I run "flutter upgrade" and this is my flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows
[Version 10.0.18362.295], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK
version 28.0.3) [√] Android Studio (version 3.4) [√] VS Code, 64-bit
edition (version 1.38.0) [!] Connected device
! No devices available
! Doctor found issues in 1 category.
and this is my "flutter --version"
Flutter 1.7.8+hotfix.4 • channel stable •
https://github.com/flutter/flutter.git Framework • revision 20e59316b8
(7 weeks ago) • 2019-07-18 20:04:33 -0700 Engine • revision fee001c93f
Tools • Dart 2.4.0
Any idea how to solve it?
Running
pub global activate stagehand
allows it to work again.