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

[Bug]: Can't generate code #1070

Closed
ebelevics opened this issue Dec 18, 2022 · 2 comments · Fixed by #1072
Closed

[Bug]: Can't generate code #1070

ebelevics opened this issue Dec 18, 2022 · 2 comments · Fixed by #1072

Comments

@ebelevics
Copy link

ebelevics commented Dec 18, 2022

What happened?

After generating code I get this error. Everything was working until upgrading flutter to 3.3.10.
dependency_overrides: analyzer: ^4.7.0 would not work any more with never flutter version, but upgrading to dependency_overrides: analyzer: ^5.2.0 causes this exception, and don't know what to do now

Repro steps

% flutter pub run build_runner build --delete-conflicting-outputs
[INFO] Generating build script...
[INFO] Generating build script completed, took 192ms

[INFO] Precompiling build script......
[WARNING] ../../FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/realm_generator-0.8.0+rc/lib/src/pseudo_type.dart:13:7: Error: The non-abstract class 'PseudoType' is missing implementations for these members:
 - DartType.element
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 PseudoType extends TypeImpl {
      ^^^^^^^^^^
../../FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-5.2.0/lib/dart/element/type.dart:38:16: Context: 'DartType.element' is defined here.
  Element? get element;
               ^^^^^^^
../../FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/realm_generator-0.8.0+rc/lib/src/pseudo_type.dart:18:84: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
  PseudoType(this._name, {this.nullabilitySuffix = NullabilitySuffix.none}) : super(null);
                                                                                   ^
[INFO] Precompiling build script... completed, took 413ms

[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

Version

Flutter 3.3.10 / Dart 2.18.6

What Realm SDK flavor are you using?

Local Database only

What type of application is this?

Flutter Application

Client OS and version

macOS Monterey 12.6

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

@dotjon0
Copy link

dotjon0 commented Dec 18, 2022

Afternoon @ebelevics looking at your command flutter pub run build_runner build --delete-conflicting-outputs this suggests you may be using the build_runner to run builds other than building realm models (i.e. flutter pub run realm generate)? If yes, there may be other builds (other than realm) conflicting with realm model builder. If yes, have you tried removing all custom build_runner builds other than realm to see if this issue persists? To confirm and to further feedback could you provide a minimal reproducible example of the source so that we can spin this up on our end to replicate the exact issue.

@ebelevics
Copy link
Author

ebelevics commented Dec 18, 2022

Yeah, I just tried to create new project, added realm and run flutter pub run build_runner build --delete-conflicting-outputs, and all generated fine. But after adding freezed: ^2.3.2 into mix that given error occured, so it seems it's not realm issue.
Thank you

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

Successfully merging a pull request may close this issue.

2 participants