question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React-native link doesn't work when you have CocoaPods in your project

See original GitHub issue

Note: If your iOS project is using CocoaPods (contains Podfile) and linked library has podspec file, then react-native link will link library using Podfile.

Source: https://facebook.github.io/react-native/docs/linking-libraries-ios.html#step-2

The automatic linking with react-native link react-native-svg doesn’t work however if you have a Podfile in your project. I get errors like
Warning: Native component for "RNSVGSvgView" does not exist
or
No component found for view with name "RNSVGPath"
when I try to render svgs.

When I manually link the react-native-svg packages, by following the first two stepts here (https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking), the errors go away and everything works fine.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

2reactions
emileflemingcommented, Jun 6, 2018

@petrogad I just ran into this as well, adding pod 'RNSVG', :path => '../node_modules/react-native-svg' to my podfile and letting CocoaPods handle it solved it for me.

0reactions
emileflemingcommented, Jun 6, 2018

@petrogad Try adding this to the end of your Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end
Read more comments on GitHub >

github_iconTop Results From Across the Web

React-native link doesn't work when you have CocoaPods in ...
I'm experiencing the same exact problem. The libraries folder doesn't include the necessary code, probably cocoapods couldn't find the header ...
Read more >
Resolving CocoaPods issues in React Native project - Medium
The goal of this blog is to provide steps to help you resolve commonly faced issues related to CocoaPods in React Native projects....
Read more >
Error: Failed to install CocoaPods dependencies for iOS ...
Try to open up Xcode, and it will ask to install the required dependencies/component for it to work (usually due to some update);...
Read more >
Troubleshooting - React Native
If you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, like...
Read more >
How to add React Native to an existing iOS app in 2022 - Fek.io
React Native uses Cocoapods to add iOS dependencies when you add new modules to your application. Cocoapods is a dependency manager for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found