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

dart run realm generate stopped working and no error was reported #1317

Closed
dotjon0 opened this issue Jun 11, 2023 · 15 comments
Closed

dart run realm generate stopped working and no error was reported #1317

dotjon0 opened this issue Jun 11, 2023 · 15 comments

Comments

@dotjon0
Copy link

dotjon0 commented Jun 11, 2023

What happened?

The following command has stopped working...

dart run realm generate

Repro steps

When running dart run realm generate the below is outputted in the terminal, no errors are reported in the terminal and no .g auto generated realm files are generated...

Building package executable... (1.5s)
Built realm:realm.

We have tried flutter pub clean cache and flutter clean and reinstalled flutter pub get, with no luck.

Version

realm 1.2.0, flutter 3.10.1

What Atlas Services are you using?

Both Atlas Device Sync and Atlas App Services

What type of application is this?

Flutter Application

Client OS and version

MacOS 13.3.1

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

@desistefanova
Copy link
Contributor

Hi @dotjon0!
We will investigate that.
Meanwhile, you can try to upgrade to flutter 3.10.4 and to check if you will have the same issue.
You can also try flutter pub run build_runner build --delete-conflicting-outputs or dart run build_runner build --delete-conflicting-outputs

@dotjon0
Copy link
Author

dotjon0 commented Jun 11, 2023

thank you @desistefanova. we have tried upgrading to flutter 3.10.4 and it made no difference.

when we run flutter pub run build_runner build --delete-conflicting-outputs it forces us to add the dependency build_runner: ^2.4.5, which we added. However when running flutter pub run build_runner build --delete-conflicting-outputs or dart run build_runner build --delete-conflicting-outputs it then gives the following error in the terminal:

Building package executable... (1.3s)
Failed to build build_runner:build_runner:
../../../../.pub-cache/hosted/pub.dev/build_runner_core-7.2.6/lib/src/logging/build_for_input_logger.dart:13:7: Error: The non-abstract class 'BuildForInputLogger' is missing implementations for these members:
 - Logger.onLevelChanged
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class BuildForInputLogger implements Logger {
      ^^^^^^^^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/logging-1.2.0/lib/src/logger.dart:162:22: Context: 'Logger.onLevelChanged' is defined here.
  Stream<Level?> get onLevelChanged {

Thus the realm file generation fails. We had checked the referenced packages logger 1.2.0 and this is the current version. is the above error to do with realm i.e. does realm use logger 1.2.0?

@desistefanova
Copy link
Contributor

desistefanova commented Jun 11, 2023

What if you run:
dart run realm generate --clean
and then
dart run realm generate?
This should force the generating.

@dotjon0
Copy link
Author

dotjon0 commented Jun 11, 2023

[updated for others]

I get the following and the .g auto generated files still fail to appear:

dart run realm generate --clean:
Building package executable... Built realm:realm.

dart run realm generate:
Building package executable... Built realm:realm.

@desistefanova
Copy link
Contributor

Yes, it is "generate". I edited my response above.
Is it possible for you to delete the dependency to the build_runner? Do you use it for something else? What was the version of the buil_runner in your pubspec.yaml before upgrading?

@dotjon0
Copy link
Author

dotjon0 commented Jun 11, 2023

No we did not have build_runner before, so I removed build_runner and I get the same (as below) with no .g files auto generated...

dart run realm generate --clean:
Building package executable...  Built realm:realm. 
dart run realm generate:
Building package executable...  Built realm:realm. 

@desistefanova
Copy link
Contributor

desistefanova commented Jun 11, 2023

Ahh, yes!
It happens to me, but only on the Mac OS.
It works on Windows and Linux.
I will investigate it.
Thanks for reporting.

@dotjon0
Copy link
Author

dotjon0 commented Jun 11, 2023

Ah brilliant you can replicate. Thanks for confirming

@desistefanova
Copy link
Contributor

desistefanova commented Jun 11, 2023

This error appears because of the logging package, since the Logger class is implemented inside build_runner core. The issue is fixed in build_runner core. In order to get the fix, just run:

  • dart pub upgrade
    and then
  • dart run realm generate

@dotjon0
Copy link
Author

dotjon0 commented Jun 11, 2023

Ah yes I thought it was strange the logging package was throwing an error in the above thread. So I tried what you suggested and it did not work, so I then re-added the build_runner: ^2.4.5 as a dev dependency (even though we do not use build_runner) and retried what you suggested (dart pub upgrade and dart run realm generate) and it worked. Thank you so much for your help on this. Perhaps dart run realm generate was hiding the issue we had, so not sure if there is a way to catch and report this.

@desistefanova
Copy link
Contributor

Great!
build_runner: ^2.4.5 shouldn't be needed in the dependencies. Probably, if you try to clean and get the packages again it will be fixed.
Yes, definitely, we will check why the error is not reported to the console.

@dotjon0
Copy link
Author

dotjon0 commented Jun 11, 2023

Thank you so much again @desistefanova

@sync-by-unito sync-by-unito bot changed the title dart run realm generate stopped working dart run realm generate stopped working and no error is reported Jun 11, 2023
@desistefanova desistefanova changed the title dart run realm generate stopped working and no error is reported dart run realm generate stopped working and no error was reported Jun 11, 2023
@ricardoamador
Copy link

@desistefanova thank you for the steps to upgrade!

@VikasAwate5
Copy link

on mac machine it didn't work. getting below response and nothing changes. ->

Building package executable...
Built realm:realm.

@dotjon0
Copy link
Author

dotjon0 commented Nov 7, 2023

on mac machine it didn't work. getting below response and nothing changes. ->

Building package executable... Built realm:realm.

@VikasAwate5 if you see the resolution steps above which resolved this (I had exactly the same issue, thus this issue)

@dotjon0 dotjon0 closed this as completed Nov 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants