본문 바로가기
오류 해결💡

[Flutter] Error: 'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and 'package:google_fonts/src/asset_manifest.dart'.

by jungha_k 2023. 6. 22.

🤔오류 상황

오류 문구 :
Error: 'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and 'package:google_fonts/src/asset_manifest.dart'.

 

가 뜨면서 플러터 빌드가 안되는 상황! 

터미널에 flutter clean 으로 빌드되었던 캐시를 날리고 다시 pub get 을 해주었지만 똑같은 오류가 났다.

 


💡해결 방안

 

https://dev.to/curtlycritchlow/how-to-fix-assetmanifest-is-imported-from-both-packageflutter-and-packagegooglefonts-error-28e8

 

How to Fix 'AssetManifest' is imported from both 'package:flutter...' and 'package:google_fonts...' error

Indroduction In this article I'll share with you how to fix'AssetManifest' is imported...

dev.to

 

이 글에서 보니 pubspec.yaml 파일에서

구글 폰트 라이브러리의 버전이 맞지 않아서 나오는 문제였다.

 

현재 참고하고 있는 교재가 조금 오래된 것이다보니 너무 예전 버전이었던 것.

최신 버전이 5 대인데

내가 치던 코드는 무려 2버전이었다ㅋㅋ

 

앞으로도 이런 오류들을 해결하기 위해 찾게된 Version Lens란 

vsCode Extension이 있다!

해당 익스텐션을 깔게 되면

야믈파일에서 파란색 V를 누를 경우 맞춰줘야할 최소 버전과 최신 버전을 알려준다.

하나하나 찾지 않고 한꺼번에 많은 dependencies 들을 업그레이드 할 수 있어서 추천한다! 😊

의외로 간단했던 문제..

댓글