React native React本机多个命令生成同一文件

React native React本机多个命令生成同一文件,react-native,React Native,我尝试为iOS构建react本机应用程序,但遇到以下错误: Build system information error: Multiple commands produce '/Volumes/Data/sources/react-native/test/ios/build/test/Build/Products/Debug-iphonesimulator/test.app/Zocial.ttf': 1) Target 'test' (project 'test') has copy comm

我尝试为iOS构建react本机应用程序,但遇到以下错误:

Build system information
error: Multiple commands produce '/Volumes/Data/sources/react-native/test/ios/build/test/Build/Products/Debug-iphonesimulator/test.app/Zocial.ttf':
1) Target 'test' (project 'test') has copy command from '/Volumes/Data/sources/react-native/test/node_modules/react-native-vector-icons/Fonts/Zocial.ttf' to '/Volumes/Data/sources/react-native/test/ios/build/test/Build/Products/Debug-iphonesimulator/test.app/Zocial.ttf'
2) That command depends on command in Target 'test' (project 'test'): script phase “[CP] Copy Pods Resources”

您可以尝试删除ios目录中的生成文件夹,然后再次重建应用程序。它可能会解决这个问题

看起来您已经安装了一些带有iOS未链接字体的库。试试这个:

  • 在项目中创建一个空目录以存储一些将来有用的字体(例如“Nunito”系列字体)。我建议将
    font
    文件夹创建到
    assets
    -->
    assets/font

  • 在项目根目录中创建一个名为
    react native.config.js
    的新文件,并将以下内容添加到其中:

  • 在项目目录中运行
    react-native链接

  • 转到
    ios
    dir(
    cd-ios
    )并运行
    pod-update

  • 建造


  • 特别要感谢亚历克斯·比德尔:

    可惜没有
    module.exports = {
        project: {
            ios: {},
            android: {}
        },
        assets: ['./src/assets/fonts/'],
    };