【Flutter开发技巧】Codepoint 60007 not found in font, aborting. 报错爬坑

1,022 阅读1分钟

今天跟大家分享的是:flutter build apk无法打包成功的爬坑总结

报错如下:

asscre@AsscredeMacBook-Pro % flutter build apk

Codepoint 60007 not found in font, aborting.                            
                                                                 
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/Users/asscre/tick/flutter/packages/flutter_tools/gradle/flutter.' line: 904
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildProfile'.            
> Process 'command '/Users/asscre/tick/flutter/bin/flutter'' 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 45s                                                  
Running Gradle task 'assembleProfile'...                                
Running Gradle task 'assembleProfile'... Done                     105.8s
Gradle task assembleProfile failed with exit code 1

解决思路:

1.猜想一是否是gradle的配置问题导致的无法打包
2.猜想二是否是代码错误

着手解决

对猜想一下手

image.png

在反复对比git commit记录中,发现gradle配置文件一直都未修改过

然后尝试flutter clean清除一下build缓存文件,发现依然无法解决。【因为本就不是这个原因

把目光移到猜想二

那到底是啥代码会引发这个问题的勒,后来我把目光移到了这句话

image.png 如字面意思,无法找到字体导致中断!

😭

原来是同事在添加新的icon后并未更新最新的iconfont文件,导致代码编译的过程中无法找到对应的icon所以触发这个问题。

直接下载最新的iconfont文件替换,OK👌搞定!

我是Asscre,一个常年喜欢瞎掰的正义美少男。如果本文对你有所启发,请点赞👍支持下哈! 嗯哼?没有?那请你点赞👍告诉我吧!哈哈哈