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

build_runner failed after upgrading my flutter #1427

Open
casontek opened this issue May 7, 2024 · 0 comments
Open

build_runner failed after upgrading my flutter #1427

casontek opened this issue May 7, 2024 · 0 comments

Comments

@casontek
Copy link

casontek commented May 7, 2024

i am unable to generate my model file after upgrading my flutter and dart sdk

dart --version
Dart SDK version: 3.5.0-103.0.dev (dev) (Thu Apr 25 17:03:06 2024 -0700) on "macos_x64"

flutter --version
Flutter 3.22.0-18.0.pre.30 • channel master • https://github.com/flutter/flutter.git
Framework • revision 5f0628d335 (11 days ago) • 2024-04-26 02:23:26 -0400
Engine • revision d794580077
Tools • Dart 3.5.0 (build 3.5.0-103.0.dev) • DevTools 2.35.0-dev.8

pubspec.yaml

environment:
sdk: '>=3.3.0-273.0.dev <4.0.0'

dev_dependencies:
flutter_test:
sdk: flutter
bloc_test: ^9.1.3
build_runner: ^2.4.9
json_serializable: ^6.7.1

model object

import 'package:json_annotation/json_annotation.dart';

part 'p_user.g.dart';

@JsonSerializable()
class User {
String name;
String phone;
String state;
String country;
String address;

User({
this.name = '',
this.phone = '',
this.country = '',
this.address = ''
});

factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);

Map<String, dynamic> toJson() => _$UserToJson(this);

}

Build Error

[INFO] Precompiling build script... completed, took 147ms
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

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

No branches or pull requests

1 participant