12

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:

  1. I'm executing the application in Chrome, not in devices.
  2. I have tried in both the Master and Beta channels.
  3. I did Flutter clean, Flutter pub get and delete .vscode still issue is not resolved.

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

RED.Skull
  • 1,696
  • 3
  • 24
  • 49
  • Its resolved by regenerating the Gradle file. And I switch to Android studio to resolve all other dependency – RED.Skull Jul 21 '20 at 05:25

3 Answers3

19

"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

murt
  • 3,790
  • 4
  • 37
  • 48
3

If you're not using Flutter to create a web application, you could drop the web support with the following command:

flutter config --no-enable-web
Furkan Cetintas
  • 600
  • 5
  • 13
1

Try To open Flutter Installation root using vs code

and delete .pub-cache/ - some time it will be hided

and run flutter pub cache repair

re-start vscode