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 adds duplicated lines to ios project.pbxproj file

See original GitHub issue

Say you link 2 or more native modules, it will result in a file with these lines or something similar, which is weird:

LIBRARY_SEARCH_PATHS = (
	"$(inherited)",
	"\"$(SRCROOT)/$(TARGET_NAME)\"",
	"\"$(SRCROOT)/$(TARGET_NAME)\"",
	"\"$(SRCROOT)/$(TARGET_NAME)\"",
	"\"$(SRCROOT)/$(TARGET_NAME)\"",
	"\"$(SRCROOT)/$(TARGET_NAME)\"",
);

Environment

Environment:
  OS: macOS High Sierra 10.13.3
  Node: 9.7.1
  Yarn: 1.5.1
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.2.0 => 16.2.0
  react-native: 0.52.0 => 0.52.0

Expected Behavior

if the required line exists, don’t add new duplicated lines

Actual Behavior

it adds repeating lines

Steps to Reproduce

just link 2 or more native modules

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
simonbuchancommented, Mar 12, 2018

Sounds like the same thing I’m seeing on android, duplicate additions to android/gradle.properties and .../MainApplication.java each time link is run. I don’t think it did that before.

1reaction
sarawallebocommented, Mar 15, 2019

I reported this issue in react-native-cli since I could not find that it had been reported in their repo

https://github.com/react-native-community/react-native-cli/issues/236

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native XCode Project Product Archive Fails with ...
The answer is that there is two copies of React Native in the Xcode ... the link above: the app may become larger...
Read more >
react-native-camera-document - npm
Rename the new folder to "Frameworks". Right click on "Frameworks" and select "add files to 'YOUR_PROJECT'". Select all content from the folder ...
Read more >
How to add and remove custom fonts in React Native - Medium
1. First step. Collect all fonts you want to use for IOS and Android and place it in the directory inside your project....
Read more >
Demystifying react-native modules linking - Brigad Engineering
Using react-native link package-name will edit your .pbxproj file (and you ... Open your project inside Xcode using the .xcworkspace .
Read more >
Easier React Native upgrades with rn-diff | by Nicolas Cuillery
That is the worst part: some files in the ios directory are not even supposed to be read by a human… The project.pbxproj...
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