我正在尝试构建一个flutter web应用程序。 在Windows 10上本地开发时一切都很正常,但当我构建和部署应用程序时,它只能在我的桌面Chrome浏览器中工作。 从Android或iOS浏览器访问它会出现白屏。
flutter channel master
。Flutter Upgrade
。Flutter config--Enable-Web
。Flutter create MyWebApp
。cd webapp
。Flutter build Web
。cd build\web
和`http-server).是我做错了什么,还是flutter坏了?
Flutter doctor-V
输出:
[√] Flutter (Channel master, 1.19.0-4.0.pre.67, on Microsoft Windows [Version 10.0.18362.836], locale en-CA)
• Flutter version 1.19.0-4.0.pre.67 at C:\_code\sdks\flutter
• Framework revision f2320c3b7a (14 hours ago), 2020-06-04 14:45:17 -0700
• Engine revision 859d892f1f
• Dart version 2.9.0 (build 2.9.0-13.0.dev 54adfeb93f)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\_code\sdks\android
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = C:\_code\sdks\android
• Java binary at: C:\Program Files\Android\Android Studio\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 Studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.45.1)
• VS Code at C:\Users\Brent\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.11.0
[√] Connected device (2 available)
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.97
• No issues found!
null
切换到beta
通道解决了此问题。 切换回master
后,问题没有返回。
我也清洗了我的flutter安装,但它似乎没有任何问题,所以不确定这是否有任何影响:
git clean -xfd
git pull
flutter doctor