Skip to main content

Command Palette

Search for a command to run...

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

Published
1 min read
C

I am a highly dedicated Flutter developer with a strong passion for creating impactful apps that enhance productivity, streamline record-keeping, and facilitate data-driven decision making. My goal is to contribute to the success of companies by leveraging my skills in Flutter development.

Introduction

In this article I'll share with you how to fix'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and 'package:google_fonts/src/asset_manifest.dart'.

When you run your flutter app you might notice this error in your debug console.

Launching lib/main.dart on SM A225M in debug mode...
main.dart:1
Warning: Errors limit exceeded. To receive all errors set com.sun.xml.bind logger to FINEST level.
Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
: Error: 'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and 'package:google_fonts/src/asset_manifest.dart'.
google_fonts_base.dart:14
import 'asset_manifest.dart';
^^^^^^^^^^^^^

Solution

Fortunately, this is a simple fix, update your google_fonts: package in pubspec.yaml to the latest version

Run your Flutter app and your code should be fine.

Connect with me

Thank you for reading my post. Feel free to like, comment, subscribe