当前位置: 首页 > news >正文

react-native-vector-icons打包报错并且提示:copyReactNativeVectorIconFonts相关信息

使用react-native-vector-icons,打包时会报:

FAILURE: Build failed with an exception.
* What went wrong:
Some problems were found with the configuration of task ':app:copyReactNativeVec
torIconFonts' (type 'Copy').- Gradle detected a problem with the following location: 'D:\rnDemo7\android\a
pp\build\intermediates\ReactNativeVectorIcons\fonts'.Reason: Task ':app:lintVitalAnalyzeRelease' uses this output of task ':app:c
opyReactNativeVectorIconFonts' without declaring an explicit or implicit depende
ncy. This can lead to incorrect results being produced, depending on what order
the tasks are executed.Possible solutions:1. Declare task ':app:copyReactNativeVectorIconFonts' as an input of ':app
:lintVitalAnalyzeRelease'.2. Declare an explicit dependency on ':app:copyReactNativeVectorIconFonts'from ':app:lintVitalAnalyzeRelease' using Task#dependsOn.3. Declare an explicit dependency on ':app:copyReactNativeVectorIconFonts'from ':app:lintVitalAnalyzeRelease' using Task#mustRunAfter.

解决办法有两种:

一、在项目根文件夹中运行:yarn add react-native-vector-icons  对react-native-vector-icons进行修复。

二、修改您的项目文件夹  node_modules/react-native-vector-icons/fonts. gradle文件

afterEvaluate {android.applicationVariants.all { def variant ->def targetName = variant.name.capitalize()++++  def lintVitalAnalyzeTask = tasks.findByName("lintVitalAnalyze${targetName}")  ++++  if (lintVitalAnalyzeTask) {  ++++     lintVitalAnalyzeTask.dependsOn(fontCopyTask)++++  } def generateAssetsTask = tasks.findByName("generate${targetName}Assets")generateAssetsTask.dependsOn(fontCopyTask)}
}

然后在项目根文件夹中运行:npx patch-package react-native-vector-icons 进行修复。

相关文章:

  • 20_大模型微调和训练之-基于LLamaFactory+LoRA微调LLama3后格式合并
  • 详解大语言模型生态系统概念:lama,llama.cpp,HuggingFace 模型 ,GGUF,MLX,lm-studio,ollama这都是什么?
  • LeetCode 2302 统计得分小于K的子数组数目(滑动窗口)
  • “连接世界的桥梁:深入理解计算机网络应用层”
  • 第十六届蓝桥杯 2025 C/C++组 脉冲强度之和
  • Leetcode 3533. Concatenated Divisibility
  • python中 str.strip() 是什么意思
  • CPU 空转解析
  • Spring Cloud 项目中优雅地传递用户信息:基于 Gateway + ThreadLocal 的用户上下文方案
  • oracle 批量查询每张表的数据量
  • 基于STM32、HAL库的AT88SC0104CA安全验证及加密芯片驱动程序设计
  • Linux/AndroidOS中进程间的通信线程间的同步 - 管道和FIFO
  • PyTorch实际上是按照**行优先(Row-Major)**的方式存储数据
  • 公路安全知识竞赛主持稿串词
  • Vim 中替换字符或文本
  • 无锡哲讯科技:SAP财务系统——赋能企业智慧财务管理
  • DeepSeek主动学习系统:低质量数据炼金术的工程化实践
  • SpringBoot Actuator未授权访问漏洞的全面解析与解决方案
  • 2025年欧洲西南部大停电
  • 顺序结构双链表的实现
  • 国家网信办举办在欧中资企业座谈会,就数据跨境流动等进行交流
  • 万达电影去年净利润亏损约9.4亿元,计划未来三年内新增25块IMAX银幕
  • 日菲同意扩大安全合作,外交部:反对任何在本地区拉帮结派的做法
  • 屠呦呦当选美国国家科学院外籍院士
  • 浙商银行一季度净赚超59亿微增0.61%,非息净收入降逾22%
  • 打工人的“小长假模式”,已经迫不及待地开启了