Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 54 forks source link

Problem with pub run build_runner build #163

Closed Pepperychef closed 4 years ago

Pepperychef commented 4 years ago

first of all, i must say that i love this orm, but from today and without knowing why i cant generate nothing with the build_runner command. Everytime i try this is the output.

[INFO] Generating build script... [INFO] Generating build script completed, took 278ms

[INFO] Creating build script snapshot...... [INFO] Creating build script snapshot... completed, took 15.6s

You have hit a bug in build_runner Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues

NoSuchMethodError: The getter 'futureDynamicType' was called on null. Receiver: null Tried calling: futureDynamicType dart:core Object.noSuchMethod package:analyzer/src/dart/element/element.dart 5853:40 >LibraryElementImpl.createLoadLibraryFunctionForLibrary package:analyzer/src/dart/element/element.dart 5703:9 >LibraryElementImpl.createLoadLibraryFunction package:analyzer/src/summary/resynthesize.dart 339:24 >SummaryResynthesizer.getLibraryElement. dart:collection _LinkedHashMapMixin.putIfAbsent package:analyzer/src/summary/resynthesize.dart 327:36 >SummaryResynthesizer.getLibraryElement package:analyzer/src/summary/resynthesize.dart 390:20 >SummaryResynthesizer._buildTypeProvider package:analyzer/src/summary/resynthesize.dart 178:5 new SummaryResynthesizer package:analyzer/src/summary/package_bundle_reader.dart 346:9 new >StoreBasedSummaryResynthesizer package:analyzer/src/summary/package_bundle_reader.dart 322:26 >ResynthesizerResultProvider.createResynthesizer package:analyzer/src/summary/package_bundle_reader.dart 80:5 new >InputPackagesResultProvider package:analyzer/src/dart/sdk/sdk.dart 96:19 AbstractDartSdk.context package:analyzer/src/context/context.dart 1884:46 PartitionManager.forSdk package:analyzer/src/context/context.dart 681:50 >AnalysisContextImpl.createCacheFromSourceFactory.createCache package:analyzer/src/context/context.dart 686:38 >AnalysisContextImpl.createCacheFromSourceFactory package:analyzer/src/context/context.dart 413:14 AnalysisContextImpl.sourceFactory= package:build_resolvers/src/resolver.dart 95:14 new AnalyzerResolver package:build_resolvers/src/resolver.dart 449:32 new AnalyzerResolvers package:build_runner_core/src/generate/options.dart 132:19 BuildOptions.create package:build_runner/src/generate/build.dart 90:36 build package:build_runner/src/entrypoint/build.dart 28:24 BuildCommand.run package:args/command_runner.dart 197:27 CommandRunner.runCommand package:args/command_runner.dart 112:25 CommandRunner.run. dart:async new Future.sync package:args/command_runner.dart 112:14 CommandRunner.run package:build_runner/src/entrypoint/run.dart 23:31 run .dart_tool\build\entrypoint\build.dart 18:22 main

pub finished with exit code 1

i dont get why this is happening.

here is a test project i used to try this outside of my main project.

https://github.com/Pepperychef/test_jaguar

jaumard commented 4 years ago

I don't have any problem on your sample project, it compile just fine. Be sure you are using flutter pub pub run build_runner build and not pub run build_runner build like your title say.

jaumard commented 4 years ago

I've tested with last flutter stable on my side :)

Pepperychef commented 4 years ago

I was using the flutter packages pub run build_runner build and after your response i tried the flutter pub pub run build_runner build just in case but didn't work.

But saying that you was using the last flutter stable version makes me check.

I was using the latest flutter from the master branch, just changing the branch to stable solved the problem.

I think that the dart team changed how the analyzer works in the master and the dev branches and the build_runner was the one that wasn't working how it is supposed.

In any case tnx for the help.

Skepticam commented 4 years ago

Switched to flutter stable branch worked for me!

JamesMcIntosh commented 4 years ago

Looks like you need to upgrade build_runner or analyzer https://github.com/dart-lang/build/issues/2476 https://github.com/dart-lang/build/issues/2482

u007 commented 4 years ago

yes, can someone allow build_runner v 1.1.0? im having the same problem

nabilanam commented 4 years ago

I am already in flutter master branch. Ran flutter pub pub run build_runner build Ran flutter pub upgrade And still the same error

Pepperychef commented 4 years ago

I am already in flutter master branch. Ran flutter pub pub run build_runner build Ran flutter pub upgrade And still the same error

change flutter to the "stable" branch nabilanam