"flutter web is currently not supported" - flutter

I'm making a website in flutter web
When I use the command
webdev serve
Everything works, but when I use the command
flutter build web
I get this error:
Downloading Web SDK... 1,6s
"build web" is not currently supported.
This is my flutter version
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.15 xxxx, locale xxx)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.40.0)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
Thanks in advance!

I also faced the same issue.
Follow the official documentation
In my case, I missed to execute the following command
> flutter config --enable-web
Also, ensure that you are in the 'Dev' channel
flutter channel dev

Flutter 1.9 has early support for web application and the message seems to say you're not using a channel which has the web development
Did you change the channel to be able to build your web application: flutter channel dev, upgrade flutter, enable web in the configuration?
I don't use webdev serve but flutter run -d chrome
When running flutter doctor -v, you should have something like:
[✓] Flutter (Channel master, v1.10.15-pre.272, on Mac OS X 10.13.4 17E199, locale fr-FR)
• Flutter version 1.10.15-pre.272 at /Users/erictaix/development/tools/flutter
• Framework revision 5bc7fb6835 (13 days ago), 2019-10-27 21:25:13 -0700
• Engine revision 3ebf006904
• Dart version 2.6.0 (build 2.6.0-dev.8.2 6354b0b97d)
...
[✓] Connected device (3 available)
• macOS • macOS • darwin-x64 • Mac OS X 10.13.4 17E199
• Chrome • chrome • web-javascript • Google Chrome 78.0.3904.97
• Web Server • web-server • web-javascript • Flutter Tools
Note that flutter use master channel on my computer (dev should work) and in connected devices, you can see Chrome and Web Server.
My version is 1.10 because as mentioned, I use the channel master which is not stable at all. But with dev channel it should work. Please refer to the documentation for up-to-date instructions: https://flutter.dev/docs/get-started/web

Related

Flutter VS code plugin stuck Waiting for connection from debug service on Chrome

I am using VS Code for Flutter developement since a long time and up until now, launching the web version from VS code has worked just fine. However, similar to what others have posted I now get a "Waiting for connection from debug service on Chrome...".
The Chrome window opens but the URL just says: "http://localhost:57698/" and the page is white.
If I click reload, the URL changes to "http://localhost:57698/#/" and the page loads correctly. This seem to match other peoples experience for this problem, that hot reloading or similar loads the page.
If I launch the web version from the command line with: "flutter run -d chrome" it also works fine. It is only when launching from VSCode it no longer works (and it has been ok for 2 years). I have tried to restart the whole computer as well as Chrome and VS code and I have done flutter clean, still the same. I have also tested on 2 different computers, no change. Is there some magic thing in Chrome that can get stuck or what could have happened?
My flutter doctor says that all is ok:
[✓] Flutter (Channel stable, 2.10.5, on macOS 13.2 22D49 darwin-arm, locale en-ES)
• Flutter version 2.10.5 at /Users/johanlantz/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5464c5bac7 (10 months ago), 2022-04-18 09:55:37 -0700
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/johanlantz/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 11.0.11+0-b60-7772763)
[✓] VS Code (version 1.74.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Downgrading the dart and flutter VS code plugins from 3.58.0 to 3.56.0 fixed this (on two separate MacBooks with the same issue).
The latest version of the plugin switched to a new API (because an old API is being removed). Unfortunately when running on the web, it appears as if the new API is available (the VM Service version number is high enough), but the API is unfortunately not actually available.
A fix is on the way - you can get it early by switching to the Pre-Release version of the extension:

Flutter doctor - Windows Version (Unable to confirm if installed Windows version is 10 or greater)

I just updated my Flutter form 3.5.0-12.0.pre.168 to 3.6.0-1.0.pre.35 on the master channel.
Im on the master channel because on the stable channel I have troubles with keyboard inputs. But that shouldn't have to do anything with this "problem". Actually is it not a real problem, because everything is still working.
Only the Flutter doctor has a new check that I didn't had before or didn't notice.
It's checking now the Windows Version. But on my computer it is't able to check it.
I can't figure out why. Any suggestions?
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 3.6.0-1.0.pre.35, on Microsoft Windows [Version 10.0.19044.2251], locale de-DE)
[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.71.2)
[√] Connected device (3 available)
[√] HTTP Host Availability
! Doctor found issues in 1 category.
_
flutter --version
Flutter 3.6.0-1.0.pre.35 • channel master • https://github.com/flutter/flutter.git
Framework • revision c021d9177c (56 minutes ago) • 2022-11-10 23:36:02 -0800
Engine • revision 19ead2834a
Tools • Dart 2.19.0 (build 2.19.0-388.0.dev) • DevTools 2.19.0
Write in your windows prompt o Powershell:
C:\>flutter upgrade
C:\>flutter channel master
C:\>flutter doctor -v
It was an operation language problem. On English Windows versions the issue didn't appeared. But on almost every other language (in my case German) it appeared.
It got solved for the master channel.
https://github.com/flutter/flutter/issues/117890
I removed flutter SDK and installed latest SDK then this problem was solved.
Don't forget to set the path of environment.
Deleting SDK took so much times... If you couldn't remove it, just reboot PC.

How to fix Chrome showing an empty / transprarent window for a Flutter web app on Linux?

When I run a Flutter web app in Chrome using Android Studio I only get an empty / transparent window on my Linux Mint 20.2 system.
empty / transparent chrome window of flutter web app
I have already tried reinstalling Chrome, which did not help. I have tried different Flutter projects including a fresh demo project (with web support), but the transparent screen shows up regardless. The same result shows up when I run flutter run -d chrome.
Anyone know how to fix this?
These are the results of flutter doctor -v:
flutter doctor -v
[✓] Flutter (Channel stable, 2.10.3, on Linux Mint 20.2 5.14.0-1032-oem, locale en_US.UTF-8)
• Flutter version 2.10.3 at /home/janik/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7e9793dee1 (5 weeks ago), 2022-03-02 11:23:12 -0600
• Engine revision bd539267b4
• Dart version 2.16.1
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /home/janik/Android/Sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /opt/android-studio
• Flutter plugin version 66.0.1
• Dart plugin version 211.7811
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2)
• IntelliJ at /opt/idea-IU-203.7148.57
• 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
[✓] VS Code (version 1.66.1)
• VS Code at /usr/share/code
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.75
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
this seems like an issue with the latest chrome update so I expect this to be fixed soon, meanwhile as a workaround what it worked for me and I suggest you do is to use chromium instead, which works.
Install chromium and find its executable which chromium, for me is use/bin/chromium and the version of chromium installed is: Version 83.0.4103.116 (Developer Build) built on Debian bullseye/sid, running on Debian bullseye/sid (64-bit), I am running Pop O.S 20.04, Dart 2.16.1 • DevTools 2.9.2, Flutter 2.10.2 • channel stable.
In the terminal where you will run the flutter app export a variable pointing to chromium: export CHROME_EXECUTABLE=/usr/bin/chromium, now you can run:
flutter run -d chrome and it will actually use chromium which renders the window properly.
I would expect this to be fixed soon, I will open an issue on the flutter repo if it's not there yet.
Good luck.
I don't have answer, only similar problem. Mint 20.2 Ryzen 3 2200G with Radeon Vega Graphics. Transparent window in Chrome using Android Studio AND ALSO in Visual Studio Code, even when creating a new (demo) project without any own code. But Pixel mobile emulator works, no problem in 'virtual' phone!! So, is this chrome-related problem? This problem emerged a few weeks ago.
I had similar issue but clearing Chrome’s cache worked like a charm

Flutter app starts in an unusual way after reopening

I would be sounding silly but it is a real problem with me. I started flutter about a month ago and whenever I upload my app on my android device , I have never run it on an emulator ,it seems to remember its state not that state management one. I will explain what I mean.
Suppose I have my flutter with a text and appbar. So I run my app on my device It runs perfectly. Then I added a floating action button and I hot reloaded my app all is fine the floating action button is in my app. So I closed my pc and then I wanted to look at my app again So I opened it from my phone and the floating action button is gone only text and appbar.
I even uninstalled my app and reinstalled it using flutter run but there is still that problem.
Here is the output of flutter doctor
[√] Flutter (Channel beta, 1.19.0-4.1.pre, on Microsoft Windows [Version 6.3.9600], locale en-IN)
• Flutter version 1.19.0-4.1.pre at C:\flutt\flutter
• Framework revision f994b76974 (6 days ago), 2020-06-09 15:53:13 -0700
• Engine revision 9a28c3bcf4
• Dart version 2.9.0 (build 2.9.0-14.1.beta)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\Anupam Karn\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio2\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio2
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code
• VS Code at C:\Users\Anupam Karn\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.11.0
[√] Connected device (3 available)
• SM G600FY • cc07c483 • android-arm • Android 6.0.1 (API 23)
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.97
• No issues found!
Please help me sort out this issue it happens with every app I make
When you hot reload, no new apk is generated. The source code from the changed files is compiled into kernel files and sent to the mobile device’s Dart VM. The installed apk is untouched.
Read more here:
https://flutter.dev/docs/development/tools/hot-reload
So if you change something, hot reload, close the app and reopen the app it will be the old app again. If you only do flutter run (without build), you install the same old apk again. You need to run flutter build first to have an updated apk.

Flutter 1.12 app crashes on iPhone 4S (iOS 9.3.6) device

I have an app that recently I have updated to Flutter 1.12. Once I have pushed the release to Apple Store, I have reported a crash from one of my users - they have an iPhone 4S (iOS 9.3.6) device.
Prior that when my app was built with Flutter v1.9.1+hotfix.6 I have no such issues.
Here is my flutter doctor -v output:
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.14.6
18G1012,
locale en-GB)
• Flutter version 1.12.13+hotfix.8 at /Users/angel/development/flutter
• Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/setup/#android-setup for detailed
instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[!] Android Studio (not installed)
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/setup/#android-setup for detailed
instructions).
[✓] VS Code (version 1.43.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.1
I realize the feedback I am giving you guys is limited, however, since I have no such hardware in the possession and in general I have no much of experience with iOS devices, I would appreciate any advice how to proceed on this topic.
Thanks!