flutterdartmaterial-designionicons

Ionicons package in Flutter showing this warning during build - Expected to find fonts for (packages/Ionicons/Ionicons, MaterialIcons)


I am using Ionicons pagckage for Icons in my flutter app. But when executing flutter build appbundle it is showing me this error -

Expected to find fonts for (packages/Ionicons/Ionicons, MaterialIcons), but found (MaterialIcons). This usually means you are referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package that would include them, or are missing "uses-material-design: true".

I have already written uses-material-design: true in my pubspec.yaml. Here is my pubspec.yaml file -

name: my_app_name
description: A new Flutter project.

publish_to: 'none'

version: 0.0.9+9

environment:
  sdk: '>=2.18.1 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.5
  uuid: ^3.0.6
  intl: ^0.17.0
  timeago: ^3.3.0
  pinput: ^2.2.16
  confetti: ^0.7.0
  location: ^4.4.0
  latlong2: ^0.8.1
  ionicons: ^0.2.1
  provider: ^6.0.3
  geocoding: ^2.0.5
  share_plus: ^6.0.1
  flutter_map: ^3.0.0
  photo_view: ^0.14.0
  flutter_svg: ^1.1.6
  url_launcher: ^6.1.7
  firebase_auth: ^4.1.1
  firebase_core: ^2.1.1
  in_app_review: ^2.0.6
  path_provider: ^2.0.11
  image_picker: ^0.8.5+3
  auto_size_text: ^3.0.0
  google_sign_in: ^5.4.2
  webview_flutter: ^3.0.4
  carousel_slider: ^4.1.1
  flutter_spinkit: ^5.1.0
  cloud_firestore: ^4.0.4
  dropdown_button2: ^1.8.2
  email_validator: ^2.1.17
  device_info_plus: ^8.0.0
  connectivity_plus: ^3.0.2
  purchases_flutter: ^4.3.2
  firebase_storage: ^11.0.4
  firebase_messaging: ^14.0.4
  permission_handler: ^10.2.0
  flutter_email_sender: ^5.2.0
  firebase_app_check: ^0.1.1+3
  cached_network_image: ^3.2.2
  firebase_ui_firestore: ^1.0.4
  flutter_native_splash: ^2.2.11
  flutter_local_notifications: ^12.0.3
  internet_connection_checker: ^1.0.0+1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0

flutter_native_splash:
  color: "#02b866"
  image: assets/play_store_512.png
  color_dark: "#02b866"
  image_dark: assets/play_store_512.png
  android: true
  ios: true

flutter:
  uses-material-design: true
  fonts:
    - family: SFProDisplay
      fonts:
        - asset: assets/SF-Pro-Display-Black.otf
          weight: 900
        - asset: assets/SF-Pro-Display-Bold.otf
          weight: 800
        - asset: assets/SF-Pro-Display-Heavy.otf
          weight: 700
        - asset: assets/SF-Pro-Display-Light.otf
          weight: 600
        - asset: assets/SF-Pro-Display-Medium.otf
          weight: 500
        - asset: assets/SF-Pro-Display-Semibold.otf
          weight: 400
        - asset: assets/SF-Pro-Display-Regular.otf
          weight: 300

  assets:
    - assets/no-network.png

I am unable to figure out how to solve this issue. Any help would be appreciated.


Solution

  • Upgrading to 0.2.2 solved this problem for me. Check this thread.