flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.19k stars 27.49k forks source link

Flutter web : Another exception was thrown: UnimplementedError #77670

Closed angdaro closed 3 years ago

angdaro commented 3 years ago

Hi, have problem with running on Chrome browser and get error messages : Another exception was thrown: Capture

pedromassangocode commented 3 years ago

Hi @angdaro Can you please provide your flutter doctor -v, your flutter run --verbose and a minimal complete reproducible code sample? Thank you

angdaro commented 3 years ago

Hi @angdaro Can you please provide your flutter doctor -v, your flutter run --verbose and a minimal complete reproducible code sample? Thank you

Hello, Bro They work well on iOS and Android but not work on Web

pedromassangocode commented 3 years ago

Hi @angdaro Can you please provide your flutter doctor -v, your flutter run --verbose and a minimal complete reproducible code sample? Thank you

angdaro commented 3 years ago

Hi @angdaro Can you please provide your flutter doctor -v, your flutter run --verbose and a minimal complete reproducible code sample? Thank you

docotor verbose

pedromassangocode commented 3 years ago

Hi @angdaro I need the complete output of flutter run --verbose (making sure you run on a Chrome device) and a minimal complete reproducible code sample? Thank you

angdaro commented 3 years ago

flutter run --verbose

1 2

pedromassangocode commented 3 years ago

Hi @angdaro Make sure you have a supported device available before running flutter doctor -v, I still need a code that reproduces this issue as well. Please avoid posting images when not necessary, you can copy/paste text instead. Thank you

angdaro commented 3 years ago

Hi @angdaro Make sure you have a supported device available before running flutter doctor -v, I still need a code that reproduces this issue as well. Please avoid posting images when not necessary, you can copy/paste text instead. Thank you

flutter doctor -v ```bash PS E:\SERVER\www\Apps\wmk> flutter doctor -v [√] Flutter (Channel stable, 2.0.2, on Microsoft Windows [Version 10.0.18363.1440], locale en-US) • Flutter version 2.0.2 at C:\lib\flutter • Framework revision 8962f6dc68 (8 days ago), 2021-03-11 13:22:20 -0800 • Engine revision 5d8bf811b3 • Dart version 2.12.1 [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at C:\Users\Sovan Computer\AppData\Local\Android\sdk • Platform android-30, build-tools 30.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. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [√] Android Studio (version 4.1.0) • Android Studio at C:\Program Files\Android\Android Studio 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 1.8.0_242-release-1644-b01) [√] VS Code (version 1.54.3) • VS Code at C:\Users\Sovan Computer\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.20.0 [√] Connected device (2 available) • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90 • Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.54 • No issues found! ```
logs ```bash PS E:\SERVER\www\Apps\wmk> flutter run --verbose [ +66 ms] executing: [C:\lib\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ +54 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] 8962f6dc68ec8e2206ac2fa874da4a453856c7d3 [ ] executing: [C:\lib\flutter/] git tag --points-at 8962f6dc68ec8e2206ac2fa874da4a453856c7d3 [ +42 ms] Exit code 0 from: git tag --points-at 8962f6dc68ec8e2206ac2fa874da4a453856c7d3 [ ] 2.0.2 [ +35 ms] executing: [C:\lib\flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ +31 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] origin/stable [ ] executing: [C:\lib\flutter/] git ls-remote --get-url origin [ +25 ms] Exit code 0 from: git ls-remote --get-url origin [ ] https://github.com/flutter/flutter.git [ +56 ms] executing: [C:\lib\flutter/] git rev-parse --abbrev-ref HEAD [ +27 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] stable [ +63 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +51 ms] executing: C:\Users\Sovan Computer\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l [ +36 ms] List of devices attached [ +5 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ +7 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +58 ms] No supported devices connected. [ +19 ms] The following devices were found, but are not supported by this project: Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90 Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.54 If you would like your app to run on web, consider running `flutter create .` to generate projects for these platforms. [ +10 ms] "flutter run" took 222ms. [ +17 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:442:7) #2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1114:5) #3 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1009:27) #4 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12) #6 CommandRunner.runCommand (package:args/command_runner.dart:197:13) #7 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9) #8 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12) #10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5) #11 run.. (package:flutter_tools/runner.dart:64:9) #12 run. (package:flutter_tools/runner.dart:62:12) #13 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12) #15 runInContext (package:flutter_tools/src/context_runner.dart:73:10) #16 main (package:flutter_tools/executable.dart:90:3) [ +258 ms] ensureAnalyticsSent: 251ms [ +1 ms] Running shutdown hooks [ ] Shutdown hooks complete [ ] exiting with code 1 PS E:\SERVER\www\Apps\wmk> ```
angdaro commented 3 years ago

Hi @angdaro Make sure you have a supported device available before running flutter doctor -v, I still need a code that reproduces this issue as well. Please avoid posting images when not necessary, you can copy/paste text instead. Thank you

code sample ```dart class ShimmerList extends StatelessWidget { @override Widget build(BuildContext context) { int offset = 0; int time = 500; return SafeArea( child: ListView.builder( itemCount: 20, itemBuilder: (BuildContext context, int index) { offset += 5; time = 800 + offset; return Padding( padding: EdgeInsets.symmetric(horizontal: 0), child: Shimmer.fromColors( highlightColor: Colors.grey[600], baseColor: Colors.grey[700], child: ShimmerLayout(), period: Duration(milliseconds: time), )); }, ), ); } } class ShimmerLayout extends StatelessWidget { @override Widget build(BuildContext context) { double containerWidth = 280; double containerHeight = 15; return Container( margin: EdgeInsets.symmetric(vertical: 7.5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( height: 150, width: MediaQuery.of(context).size.width, color: Colors.grey, ), Column( children: [ SizedBox(height: 15), Container( height: containerHeight, width: containerWidth, color: Colors.grey, ), ], ) ], ), ); } } ```

I got error when i place , this code : ShimmerLayout () . but for IOS and Android , working fine , web not work .

angdaro commented 3 years ago

Hi @angdaro Make sure you have a supported device available before running flutter doctor -v, I still need a code that reproduces this issue as well. Please avoid posting images when not necessary, you can copy/paste text instead. Thank you

When i switch channel beta it's working , but when switch channel stable no working . And i debugged then see error with ShimmerLayout().

pedromassangocode commented 3 years ago

Hi @angdaro I cannot reproduce this issue with the code you provided in the stable and beta channel.

gif

code sample ```dart import 'package:animations/animations.dart'; import 'package:flutter/material.dart'; void main() async { runApp(MaterialApp( home: Page(), )); } class Page extends StatefulWidget { @override _PageState createState() => _PageState(); } class _PageState extends State { Widget build(BuildContext context) { return Scaffold( body: ShimmerList(), ); } } class ShimmerList extends StatelessWidget { @override Widget build(BuildContext context) { int offset = 0; int time = 500; return SafeArea( child: ListView.builder( itemCount: 20, itemBuilder: (BuildContext context, int index) { offset += 5; time = 800 + offset; return Padding( padding: EdgeInsets.symmetric(horizontal: 0), child: ShimmerLayout(), ); }, ), ); } } class ShimmerLayout extends StatelessWidget { @override Widget build(BuildContext context) { double containerWidth = 280; double containerHeight = 15; return Container( margin: EdgeInsets.symmetric(vertical: 7.5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( height: 150, width: MediaQuery.of(context).size.width, color: Colors.grey, ), Column( children: [ SizedBox(height: 15), Container( height: containerHeight, width: containerWidth, color: Colors.grey, ), ], ) ], ), ); } } ```
flutter doctor -v ```bash [✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64, locale en-AO) • Flutter version 2.0.3 at /Users/pedromassango/Code/flutter_stable • Framework revision 4d7946a68d (3 days ago), 2021-03-18 17:24:33 -0700 • Engine revision 3459eb2436 • Dart version 2.12.2 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/pedromassango/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/pedromassango/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [!] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e ! CocoaPods 1.9.3 out of date (1.10.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6915495) [✓] IntelliJ IDEA Community Edition (version 2020.3.2) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 54.0.3 • Dart plugin version 203.7759 [✓] VS Code (version 1.54.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.16.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 11.2.3 20D91 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90 ! Doctor found issues in 1 category. ```
angdaro commented 3 years ago

I have no idea about this case i will try to debug more to figure out . Thank you

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.