【问题标题】:flutter MaterialIcons-Regular.otf error when building apkflutter MaterialIcons-Regular.otf error when building apk
【发布时间】:2022-12-27 08:11:16
【问题描述】:

im trying to build the apk but im getting a

Failed to load input font

C:\Users....\flutter\bin\cache\artifacts\material_fonts\MaterialIcons-Regular.otf; aborting. This error indicates that the font is invalid or the current version of Harfbuzz is unable to process it. tried checking the previous answers but saddly nothing worked for me

    FAILURE: Build failed with an exception.
    
    * Where:
    Script 'C:\Users\.....\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156
    
    * What went wrong:
    Execution failed for task ':app:compileFlutterBuildRelease'.
    > Process 'command 'C:\Users\...\flutter\bin\flutter.bat'' finished with non-zero exit value 1
    
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 1m 28s
    Running Gradle task 'assembleRelease'...                           91.1s
    Gradle task assembleRelease failed with exit code 1

【问题讨论】:

    标签: flutter dart apk


    【解决方案1】:

    I downloaded it from here here and I created a font directory and added the icon manually. then in pubspec.yaml just add

    fonts:
    - family: MaterialIcons
      fonts:
        - asset: fonts/MaterialIcons-Regul
    

    【讨论】:

      猜你喜欢
      • 2023-02-09
      • 2022-12-10
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      • 2022-12-26
      • 2019-08-09
      • 1970-01-01
      • 2022-12-01
      相关资源
      最近更新 更多