当前位置: 首页 > 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 进行修复。

http://www.dtcms.com/a/163355.html

相关文章:

  • 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年欧洲西南部大停电
  • 顺序结构双链表的实现
  • Docker 容器双网卡访问物理雷达网络教程
  • 阿里云 CentOS YUM 源配置指南
  • 自动化立库/AGV物流仿真详细步骤
  • CentosLinux系统crontab发现执行删除命令失效解决方法
  • Kubernetes in action-Kubernetes的pod
  • 修改输入框选择框颜色
  • 第八章 磁盘管理未完待续
  • 数据库中常用的窗口函数
  • neo4j基础操作:命令行增删改查
  • 从SOA到微服务:架构演进之路与实践示例