Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing file database.g.dart in examples folder #257

Closed
cassioseffrin opened this issue Feb 11, 2020 · 3 comments
Closed

missing file database.g.dart in examples folder #257

cassioseffrin opened this issue Feb 11, 2020 · 3 comments

Comments

@cassioseffrin
Copy link
Contributor

Seems like the database.g.dart is missing

here is the complete log when I try to run the sample.

Compiler message:
lib/database.dart:9:6: Error: Error when reading 'lib/database.g.dart': No such file or directory
part 'database.g.dart';
^
lib/database.dart:9:6: Error: Can't use 'lib/database.g.dart' as a part, because it has no 'part of' declaration.
part 'database.g.dart';
^
lib/main.dart:9:26: Error: Getter not found: '$FloorFlutterDatabase'.
final database = await $FloorFlutterDatabase
^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
Failed to build bundle.
Error launching application on iPhone 11.

@nikpachoo
Copy link

@cassioseffrin, first you need to generate this file. Just run in project folder flutter packages pub run build_runner build.

@cassioseffrin
Copy link
Contributor Author

I just realize that I have forget one step:

flutter packages pub run build_runner build.

This issue can be closed!

@waleedkalyar
Copy link

hi! I am still facing the issue even after running command of flutter packages pub run build_runner build in terminal. looks like file is generated in .dart_tool but I can't access it in main file.
getIt.registerSingletonAsync(
() async => FloorAppDatabase.databaseBuilder('notes.db').build());
Here is the line of code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants