Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive error IOS: library not found for -lReact #26785

Closed
Luckygirlllll opened this issue Oct 9, 2019 · 11 comments
Closed

Archive error IOS: library not found for -lReact #26785

Luckygirlllll opened this issue Oct 9, 2019 · 11 comments
Labels
Bug Newer Patch Available Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Luckygirlllll
Copy link

When I'm trying to make an archive via Xcode, I'm getting an error: " library not found for -lReact". I have deleted Derived Data and clean the project, however, I'm still getting this error.

React Native version:

React Native Environment Info:
System:
OS: macOS 10.14.6
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 6.69 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.1, 27.0.3, 28.0.3
System Images: android-23 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.10 => 0.59.10
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-device-info: 2.0.0
react-native-gesture-handler: 1.4.1
react-native-git-upgrade: 0.2.7
react-native-maps: 0.25.0
react-native-reanimated: 1.2.0

Steps To Reproduce

  1. Create Archive for App Store

Describe what you expected to happen:
Can create archive

Snack, code example, screenshot, or link to a repository:

@Luckygirlllll Luckygirlllll changed the title Archive error: library not found for -lReact Archive error IOS: library not found for -lReact Oct 9, 2019
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.61 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@callcter
Copy link

same issue.
react-native 0.61.2

@moodseller
Copy link

Same issue here.
in Xcode workspace I can see linked RCT libraries under Libraries folder, however, none of the actual .xcodeproj files exist under node_modules/react-native/Libraries and they are not showing up red. They were automatically added when upgrading from .59 and now they are failing to build.

@Luckygirlllll
Copy link
Author

Luckygirlllll commented Oct 17, 2019

Screen Shot 2019-10-10 at 11 35 52

I have fixed that problem by manually adding React to Libraries folder in Xcode (to add React click on Libraries-> Add file to project...., then go to node_modules/react-native/React/React.xcodeproj).

I also added libraries which were in Podfile to Build Phases -> Link Binary with Libraries:

pod 'React', :path => '../node_modules/react-native', :subspecs => [
   'Core',
   'CxxBridge',
   'DevSupport',
   'RCTActionSheet',
   'RCTAnimation',
   'RCTBlob',
   'RCTGeolocation',
   'RCTImage',
   'RCTLinkingIOS',
   'RCTNetwork',
   'RCTSettings',
   'RCTText',
   'RCTVibration',
   'RCTWebSocket',
 ] 

Screen Shot 2019-10-17 at 16 22 58

@moodseller
Copy link

moodseller commented Oct 17, 2019

Are you sure you are using RN 0.6 and higher? Because manual linking should not be a thing.

I was upgrading from RN 0.59 to 0.6x
I have solved this problem by getting rid of every framework inside the libraries folder (because the .xcodeproj files don't exist in the first place). That got my project up and running and got rid of the library not found errors during the process.

It seems that if you had linked any frameworks before - you have to let pods take care of integrating them. If the pods added references of those frameworks to the library folder then that I found is definitely the incorrect way to build.

@Luckygirlllll
Copy link
Author

@wildcookie007 I'm using react-native 0.59.10, so manual linking still exists there.

@callcter
Copy link

i solved my problem when i upgraded to 0.61.2 from 0.59.5 #26812
you can try to add react.xcodeproject to Library manually at 0.59.x

@SmartArray
Copy link

I have had the same issue when upgrading to RN 0.61.2.
Just remove the references from the 'Libraries' group and you should be fine as React, React-Core, etc. will be installed via Pods

@TheoGit
Copy link

TheoGit commented Dec 17, 2019

@SmartArray so you removed all references from 'Libraries' and instead they should be added to the Podfile?

@stale
Copy link

stale bot commented Apr 17, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 17, 2020
@stale
Copy link

stale bot commented Apr 25, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Apr 25, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Newer Patch Available Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

7 participants