I'm new to flutter development. When I try to create my application in local using flutter is working fine. But if I try to import other repo after resolving the dependencies, still it's not working.
What i did:
Error Log:
--initialize-from-dill build\cache.dill.track.dill --platform
file:///C:/Users/user/Documents/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk.dill
[ +197 ms] <- compile org-dartlang-app:/web_entrypoint.dart
[+1275 ms]
Compiler message:
[ +1 ms] org-dartlang-app:/web_entrypoint.dart:7:8: Error: Error when reading 'lib/generated_plugin_registrant.dart':
The system cannot find the file specified.
[ ] import 'package:neucalcu/generated_plugin_registrant.dart';
[ ] ^
[+5310 ms] org-dartlang-app:/web_entrypoint.dart:10:3: Error: Method not found: 'registerPlugins'.
[ +1 ms] registerPlugins(webPluginRegistry);
[ ] ^^^^^^^^^^^^^^^
[+33861 ms] Syncing files to device Chrome... (completed in 40,952ms, longer than expected)
[ +1 ms] Synced 0.0MB.
[ +1 ms] Failed to compile application.
[ +4 ms] "flutter run" took 66,431ms.
doctor log:
[√] Flutter (Channel beta, 1.19.0-4.2.pre, on Microsoft Windows [Version 10.0.14393], locale en-US)
• Flutter version 1.19.0-4.2.pre at C:\Users\user\Documents\flutter
• Framework revision 9b9b543d92 (4 days ago), 2020-06-22 12:19:28 -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 30.0.0)
• Android SDK at C:\Users\user\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: C:\Users\user\Documents\Android\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.0)
• Android Studio at C:\Users\user\Documents\Android
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.46.1)
• VS Code at C:\Users\user\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.116
• No issues found!
pubspec.yml
name: Calendar app
description: A new Flutter application.
publish_to: 'none'
version: 1.2.2+8
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
flutter_circle_color_picker: ^0.2.0
google_fonts: ^1.1.0
hive: ^1.4.1+1
hive_flutter: ^0.3.0+2
line_awesome_icons: ^1.0.4+2
math_expressions: ^2.0.0
provider: ^4.1.3
url_launcher: ^5.4.10
dev_dependencies:
flutter_test:
sdk: flutter
hive_generator: ^0.7.0+2
build_runner: ^1.10.0
dependency_overrides:
dartx: ^0.4.0
path: ^1.7.0
flutter:
uses-material-design: true
assets:
- assets/logo.png
REF - https://github.com/flutter/flutter/issues/48361
generated_plugin_registrant. dart is an automatically generated file that is required to compile your Flutter project as a web application: This file generated_plugin_registrant. dart exists only to support the web. It exists if Flutter is web-enabled and there is at least one package that has asked for it.
The GeneratedPluginRegistrant is automatically generated by a FlutterApplication in order to register plugins defined in your Flutter App's pubspec.yaml file.
Once you have created your project, you will see the “lib” folder where the “main. dart” file is located. main.dart. Most importantly, once you have created a project and developed the application, Flutter expects the “main. dart” file to exist.
"Error when reading 'lib/generated_plugin_registrant.dart" Happens when you run your flutter app in chrome device after master channel upgrade without giving web support .
Solution : Give web support to your flutter by hitting below command.
flutter create .
This will create necessary support files for web app. further instruction will come in screen.
Reference last statement of this article
https://flutter.dev/docs/get-started/web
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With