Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

inject-dart Failed to snapshot build script .dart_tool/build/entrypoint/build.dart. This is likely caused by a misconfigured builder definition

I was trying to use inject-dart from Google by following this article

But when I try to generate the code with build-runner but I see this error.

[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart. This is likely caused by a misconfigured builder definition. [SEVERE] ../../../../dev/flutter/.pub-cache/git/inject.dart-4ffd3d339d8b776b2bec8d95ae6d3d168856e76c/package/inject_generator/lib/src/context.dart:106:51: Error: Method not found: 'ParsedLibraryResultImpl.tmp'. var parsedLibrary = ParsedLibraryResultImpl.tmp(element.library);
^^^

Does anyone have any idea what is causing the issue?

like image 486
erluxman Avatar asked Dec 23 '22 21:12

erluxman


1 Answers

use element.library.session.getParsedLibraryByElement(element.library);

instead of ParsedLibraryResultImpl.tmp(element.library); in Context.dart line 106

like image 74
Mary Avatar answered Jan 25 '23 23:01

Mary