Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
930 views
in Technique[技术] by (71.8m points)

dart - Flutter Web Application Shows White Screen

I try to transfer my android to a web application, and all I get is a white screen, and it stays like that for hours. If I run flutter run -d chrome --release, I receive the following:

    Target dart2js failed: Exception: Error: Could not resolve the package 'co.enroute' in 
    'package:co.enroute/generated_plugin_registrant.dart'.
    Error: Could not resolve the package 'co.enroute' in 'package:co.enroute/main.dart'.
    .dart_tool/flutter_build/c426a87289b6be7172b41ef32619e029/main.dart:7:8:
    Error: Not found: 'package:co.enroute/generated_plugin_registrant.dart'
    import 'package:co.enroute/generated_plugin_registrant.dart';
    ^
   .dart_tool/flutter_build/c426a87289b6be7172b41ef32619e029/main.dart:8:8:
    Error: Not found: 'package:co.enroute/main.dart'
    import 'package:co.enroute/main.dart' as entrypoint;
    ^
    .dart_tool/flutter_build/c426a87289b6be7172b41ef32619e029/main.dart:11:3:
    Error: Method not found: 'registerPlugins'.
    registerPlugins(webPluginRegistrar);
    ^^^^^^^^^^^^^^^
    .dart_tool/flutter_build/c426a87289b6be7172b41ef32619e029/main.dart:13:3:
    Error: Method not found: 'main'.
    entrypoint.main();
    ^^^^
    Error: Compilation failed.

When I run flutter doctor: Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, 1.25.0-8.3.pre, on Microsoft Windows [Version 10.0.18363.1316], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.1) [√] Chrome - develop for the web [√] Android Studio (version 4.0) [√] VS Code (version 1.52.1) [√] Connected device (2 available)

The code is working perfectly on Android! Thanks in advance!

question from:https://stackoverflow.com/questions/65847985/flutter-web-application-shows-white-screen

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...