0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flutter web のビルドで generated_plugin_regstrant.dart が無いと怒られる

Posted at

Flutter Web のアプリを flutter run すると、「generated_plugin_registrant.dart が存在しない」というエラーが出ることがあります。

org-dartlang-app:/web_entrypoint.dart:8:8: Error: Error when reading 'lib/generated_plugin_registrant.dart': No such file or directory
import 'package:my_package_name/generated_plugin_registrant.dart';
       ^                                                                
org-dartlang-app:/web_entrypoint.dart:11:3: Error: Method not found: 'registerPlugins'.
  registerPlugins(webPluginRegistry);                                   
  ^^^^^^^^^^^^^^^         

これは Flutter アプリのソースのルートに ./web フォルダが作成されていないと発生するエラーのようです。

./web フォルダと ./web/index.html がないとそもそも Flutter web として実行できないわけですが、フォルダが無いというエラーより前に、 generated_plugin_registrant.dart が無いというエラーが出るので、ちょっと原因が分かりにくいですね。

私は Flutter web 未対応のプラグインを web 対応に更新した際に、example アプリ用の web フォルダの作成を完全に忘れていたので、30分ほどハマってしまいました。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?