4

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?

2 Answers 2

11

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

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

Sign up to request clarification or add additional context in comments.

Comments

0

I had the same error lately, @Mary answer helped me.

Just change the Context.dart line that is causing the headache to:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.