Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am unable to build my flutter web project

When trying to run flutter build web i get "build web" is not currently supported. I had previous errors where i was stuck with Dart 2.5.0-dev.4.0.flutter-be66176534 and required 2.5.0 or higher, this has now been solved but i am unable to build my project.

flutter doctor -v
[√] Flutter (Channel stable, v1.9.1+hotfix.2, on Microsoft Windows [Version 10.0.18932.1000], locale en-GB)
    • Flutter version 1.9.1+hotfix.2 at C:\src\flutter
    • Framework revision 2d2a1ffec9 (8 days ago), 2019-09-06 18:39:49 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\germa\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[!] Android Studio (version 3.4)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] VS Code (version 1.38.1)
    • VS Code at C:\Users\germa\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.4.1

I have tried

  • re-installing dart
  • re-installing flutter
  • re-installing Visual Studio code
  • copy file contents to a new web project (same error)

I couldn't find any information on what this is caused by and how to resolve it online

What can i do to resolve this error?

like image 364
G_man Avatar asked Sep 15 '19 10:09

G_man


2 Answers

Please once do configure like below

  1. flutter channel stable
  2. flutter upgrade
  3. flutter config --enable-web
  4. cd into project directory
  5. flutter create .
  6. flutter run -d chrome
like image 189
4 revs, 3 users 43% Avatar answered Sep 23 '22 07:09

4 revs, 3 users 43%


So currently you are at stable channel . You have to switch to the beta channel as flutter web is not at a stable channel right now. In order to make it working run the following commands in the terminal.

  1. flutter channel beta
  2. flutter upgrade
  3. flutter config --enable-web.

    After that restart your IDE and build the web app.

like image 42
Jawad Ahmed Avatar answered Sep 20 '22 07:09

Jawad Ahmed