Fai*_*zer 11 xcode android ios react-native react-native-ios
我们正在开发一个 React Native 项目。我的一名团队成员在 Linux 和链接的 android 上添加了一些本机模块。到那时,我正在尝试链接 iOS 中的内容,但构建总是因这种错误跟踪而失败。Android 项目正在正常构建。
我删除xyz.xcworkspace和Podfile.lock再尝试pod install。
另外,我想删除我的node_modules,然后yarn install后面yarn link。
react-native-cli: 2.0.1
react-native: 0.61.4
yarn 1.19.1
Pod 1.8.4
XCode Version 11.2.1 (11B500)
macOS Catalina 10.15.1 (19B88)
Run Code Online (Sandbox Code Playgroud)
xyz 警告
duplicate output file '/Users/user/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Products/Debug-iphonesimulator/xyz.app/AntDesign.ttf' on task: PhaseScriptExecution [CP] Copy Pods Resources /Users/faisal/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Intermediates.noindex/xyz.build/Debug-iphonesimulator/xyz.build/Script-47F818C57EEC47EA3303EA1B.sh
Run Code Online (Sandbox Code Playgroud)
xyz 工作区错误
Multiple commands produce '/Users/user/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Products/Debug-iphonesimulator/xyz.app/Zocial.ttf':
1) Target 'xyz' (project 'xyz') has copy command from '/Users/user/Desktop/xyz/native/node_modules/react-native-vector-icons/Fonts/Zocial.ttf' to '/Users/user/Library/Developer/Xcode/DerivedData/xyz-hhesslamjsqmbobykhskliclusph/Build/Products/Debug-iphonesimulator/xyz.app/Zocial.ttf'
2) That command depends on command in Target 'xyz' (project 'xyz'): script phase “[CP] Copy Pods Resources”
Run Code Online (Sandbox Code Playgroud)
有多个类似的错误和警告,但格式相同,文件名不同。
Ami*_*avi 11
对于xCode 11+和react-native 0.60+,
答案是从这个GitHub问题答案复制的
这个问题似乎是由 React Native 0.60 中的新功能引起的- 中的
autolinking行 意味着当您这样做时,在 中找到的任何 pod都会自动链接。这意味着当您执行此操作时,所有字体文件的链接都会添加到 [CP] Copy Pods Resources 中。use_native_modules!ios/Podfilepod installnode_modulespod install如果您之前
react-native-vector-icons通过将字体文件添加到复制捆绑资源来手动安装,则会收到“多个命令产生...”致命构建错误。因此,要解决此问题,只需从 Copy Bundle Resources 中删除字体文件,以便它们仅位于 [CP] Copy Pods Resources 中。
所以关于库的存储库的官方文档已经过时并且没有提到它。您应该按照安装步骤将字体列表添加到info.plist,并且不要创建Fonts文件夹组并将字体复制粘贴到该文件夹中。
小智 7
该问题似乎是由 React Native 0.60 中的新自动链接功能引起的 - use_native_modules 行!在 ios/Podfile 中意味着当您进行 pod install 时,在 node_modules 中找到的任何 pod 都会自动链接。这意味着在执行 pod install 时,所有字体文件的链接都会添加到 [CP] Copy Pods Resources 中。
但如果您是新手,请不要担心,请查看此图片以获得更好的解决方案
3. 你会看到输入文件和输出文件只是从输出文件中删除重复的文件 4. 运行 react-native run-ios
你去:) 节省了几个小时
| 归档时间: |
|
| 查看次数: |
7771 次 |
| 最近记录: |