oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.31k stars 2.12k forks source link

Multiple targets match implicit dependency for linker flag '-lRNVectorIcons' in xcome>product>archive #1397

Closed souradeepmajumdar05 closed 2 years ago

souradeepmajumdar05 commented 2 years ago

I am trying to build using xcode>product>archive, i keep getting below error , can someone check on this

Target Integrity Group
Multiple targets match implicit dependency for linker flag '-lRNVectorIcons'. Consider adding an explicit dependency on the intended target to resolve this ambiguity. (in target 'xUI' from project 'xUI')
Error Group
Multiple commands produce '/Users/user20/Library/Developer/Xcode/DerivedData/xUI-awhgnkdgdnqqhybhizmenofqnvvg/Build/Intermediates.noindex/ArchiveIntermediates/xUI/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libRNVectorIcons.a':
1) Target 'RNVectorIcons' has a command with output '/Users/user20/Library/Developer/Xcode/DerivedData/xUI-awhgnkdgdnqqhybhizmenofqnvvg/Build/Intermediates.noindex/ArchiveIntermediates/xUI/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libRNVectorIcons.a'
2) Target 'RNVectorIcons' has a command with output '/Users/user20/Library/Developer/Xcode/DerivedData/xUI-awhgnkdgdnqqhybhizmenofqnvvg/Build/Intermediates.noindex/ArchiveIntermediates/xUI/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libRNVectorIcons.a'

pod file


require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'xUI' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  target 'xUITests' do
    inherit! :complete
    # Pods for testing
  end
  post_install do |installer|
    installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
     end
    end
   end
end
version:
 npm: '7.19.1',
 node: '16.6.0',
 react: 17.0.1 => 17.0.1 
 react-native: ^0.64.2 => 0.64.2
PeterF-Gluxkind commented 2 years ago

Xcode 13.0 react-native 0.66.0 npm 7.24.0 react-native-vector-icons 9.0.0

I was able to resolve this issue following the installation instructions with modification:

  1. Run npm i react-native-vector-icons
  2. Add the following to your Podfile and run pod update: pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  3. Edit Info.plist as described below.
    <key>UIAppFonts</key>
    <array>
    <string>AntDesign.ttf</string>
    <string>Entypo.ttf</string>
    <string>EvilIcons.ttf</string>
    <string>Feather.ttf</string>
    <string>FontAwesome.ttf</string>
    <string>FontAwesome5_Brands.ttf</string>
    <string>FontAwesome5_Regular.ttf</string>
    <string>FontAwesome5_Solid.ttf</string>
    <string>Foundation.ttf</string>
    <string>Ionicons.ttf</string>
    <string>MaterialIcons.ttf</string>
    <string>MaterialCommunityIcons.ttf</string>
    <string>SimpleLineIcons.ttf</string>
    <string>Octicons.ttf</string>
    <string>Zocial.ttf</string>
    <string>Fontisto.ttf</string>
    </array>
  4. Note: you need to recompile your project after adding new fonts, also ensure that they also appear under Copy Bundle Resources in Build Phases. DON'T DO THIS
    • Don't run npx react-native link react-native-vector-icons as it would populate Copy Bundle Resources with duplicates.

I believe this worked for me because I already found those .ttf files under Xcode > Pods > Development Pods > RNVectorIcons. With that being said, I am fairly new to Xcode and I am not sure if this will resolve your issue.

jefawks3 commented 2 years ago

I just upgraded react-native-vector-icons and was running into the same issue.

Apparently, I had run npx react-native link react-native-vector-icons at some point and this worked for me:

  1. Run npx react-native unlink react-native-vector-icons
  2. Make sure the following is in your Podfile, if not, add it and run pod install: pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  3. Make sure the following is in your Info.plist:
    <key>UIAppFonts</key>
    <array>
    <string>AntDesign.ttf</string>
    <string>Entypo.ttf</string>
    <string>EvilIcons.ttf</string>
    <string>Feather.ttf</string>
    <string>FontAwesome.ttf</string>
    <string>FontAwesome5_Brands.ttf</string>
    <string>FontAwesome5_Regular.ttf</string>
    <string>FontAwesome5_Solid.ttf</string>
    <string>Foundation.ttf</string>
    <string>Ionicons.ttf</string>
    <string>MaterialIcons.ttf</string>
    <string>MaterialCommunityIcons.ttf</string>
    <string>SimpleLineIcons.ttf</string>
    <string>Octicons.ttf</string>
    <string>Zocial.ttf</string>
    <string>Fontisto.ttf</string>
    </array>
lassiecoder commented 2 years ago

Worked for me, thanks buddy :)

leoparis89 commented 2 years ago

I just upgraded react-native-vector-icons and was running into the same issue.

Apparently, I had run npx react-native link react-native-vector-icons at some point and this worked for me:

  1. Run npx react-native unlink react-native-vector-icons
  2. Make sure the following is in your Podfile, if not, add it and run pod install: pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  3. Make sure the following is in your Info.plist:
<key>UIAppFonts</key>
<array>
  <string>AntDesign.ttf</string>
  <string>Entypo.ttf</string>
  <string>EvilIcons.ttf</string>
  <string>Feather.ttf</string>
  <string>FontAwesome.ttf</string>
  <string>FontAwesome5_Brands.ttf</string>
  <string>FontAwesome5_Regular.ttf</string>
  <string>FontAwesome5_Solid.ttf</string>
  <string>Foundation.ttf</string>
  <string>Ionicons.ttf</string>
  <string>MaterialIcons.ttf</string>
  <string>MaterialCommunityIcons.ttf</string>
  <string>SimpleLineIcons.ttf</string>
  <string>Octicons.ttf</string>
  <string>Zocial.ttf</string>
  <string>Fontisto.ttf</string>
</array>

This works but we get a warning

React native: 0.64.1


error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
josmmv commented 2 years ago

This worked for me That command depends on command in Target 'MyApp' (project 'MyApp'): script phase “[CP] Copy Pods Resources”