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

[iOS Xcode] React-Native build failed in Xcode with library not found in RN 0.60.5 #26106

Closed
0xinhua opened this issue Aug 19, 2019 · 41 comments
Closed
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@0xinhua
Copy link

0xinhua commented Aug 19, 2019

Steps To Reproduce

Using react-native run-ios is successfully, when I use Xcode to build and run the project, produce this error:

` ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/DoubleConversion’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/Folly’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RCTWeChat’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RNGestureHandler’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RNReanimated’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/RNSVG’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-Core’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-DevSupport’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTActionSheet’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTAnimation’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTBlob’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTImage’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTLinking’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTNetwork’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTSettings’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTText’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTVibration’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-RCTWebSocket’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-cxxreact’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-jsi’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-jsiexecutor’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/React-jsinspector’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/glog’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/react-native-splash-screen’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/react-native-webview’
ld: warning: directory not found for option ‘-L/Users/misery/Library/Developer/Xcode/DerivedData/example-gxstsmzrnmryezfjrdscgixueydb/Build/Products/Release-iphonesimulator/yoga’
ld: library not found for -lDoubleConversion

clang: error: linker command failed with exit code 1 (use -v to see invocation) `

My Environment:

React Native version:
v 0.60.5

Xcode version :
Version 10.0 (10A255)

Podfile:

`platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'example' do
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'RNSVG', :path => '../node_modules/react-native-svg'

pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'RNSVG', :path => '../node_modules/react-native-svg'

target 'exampleTests' do
inherit! :search_paths
end

use_native_modules!
end

target 'example-tvOS' do
target 'example-tvOSTests' do
inherit! :search_paths
end

end`

Describe what you expected to happen:

  1. run react-native run-iosand react-native run-android was both successfully.
    2.but use Xcode build button failed.
@0xinhua 0xinhua added the Bug label Aug 19, 2019
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Aug 19, 2019
@JslinSir
Copy link

the same

@0xinhua
Copy link
Author

0xinhua commented Aug 20, 2019

any suggestion or solution ?

@JslinSir
Copy link

error:library not found for -lDoubleConversion

Seek help as well.

@JslinSir
Copy link

any suggestion or solution ?

both react-native run-ios and in xcode the same error

@JslinSir
Copy link

any suggestion or solution ?

Do the below steps

go to ios/
run 'pod install' or 'pod update'
open ios/newproject.xcworkspace

@sunweiyang
Copy link
Contributor

I have no idea if this would help, but sometimes for my own app, attempting to build in Xcode multiple times in a row may result in a successful build. For example, I would try building ~5 times (each with a different 'file not found' error), and on the 6th time the build would succeed.

@bruno-trindade
Copy link

Same thing here – on both Xcode and react-native run-ios. None of these suggestions have helped. This is a project that is being upgraded from RN 0.59 to 0.60.5.

@denforlatte
Copy link

This may not help everyone but regarding the -IDoubleConversion library specifically, I noticed that my copy was incorrect so it might be worth checking.

I used this copy instead to get past the missing -IDoubleConversion: https://github.com/facebook/react-native/blob/master/third-party-podspecs/DoubleConversion.podspec

@0xinhua
Copy link
Author

0xinhua commented Aug 24, 2019

Hi guys, in fact, I don't know the real cause of this problem and how to fixed this issue.but

I JUST UPDATE MY Xcode VERSION FROM 10.0 (10A255) TO 10.3 (10G8), REOPEN AND REBUILD

IT WORKS . 😢

@the-habu
Copy link

the-habu commented Aug 27, 2019

Having the a similar problem with my midsized project after upgrading to 0.60.5. It actually fails at finding CocoaLumberjack, but I expect this to be the case because of dependency and sorting. I am not 100% sure, but release builds seem to be rather the problem than debug builds?!

I use AppCenter as my CI. I created this minimalist project (just react-native init) which also fails building there (this one actually fails at finding DoubleConversion).
Bitbucket Repo

I currently expect a problem with the generated .xcworkspace file, but that's a part I didn't dig into yet.

Here are the logs of the minimalist iOS build that fails.
logs_2.zip

@longnk-1447
Copy link

Having the a similar problem with my midsized project after upgrading to 0.60.5. It actually fails at finding CocoaLumberjack, but I expect this to be the case because of dependency and sorting. I am not 100% sure, but release builds seem to be rather the problem than debug builds?!

I use AppCenter as my CI. I created this minimalist project (just react-native init) which also fails building there (this one actually fails at finding DoubleConversion).
Bitbucket Repo

I currently expect a problem with the generated .xcworkspace file, but that's a part I didn't dig into yet.

Here are the logs of the minimalist iOS build that fails.
logs_2.zip

the same

@giniedp
Copy link

giniedp commented Sep 3, 2019

same Problem
Upgraded to react-native 0.60.5
XCode Version 10.3

@bruno-trindade
Copy link

It appears we got through our issue upgrading from 0.59 to 0.60. Maybe this will be helpful to you:

Many of the libraries we were linking to in the "Link Binary with Libraries" build step in Xcode were now present in Cocoapods. By removing all of the libraries from that build step except for libPods-Qeepsake, we were able to get past the DoubleConversion error and the build now works.

@idkraf
Copy link

idkraf commented Nov 10, 2019

same here.
react-native Version 0.61.4
XCode Version 11.1

@giniedp
Copy link

giniedp commented Nov 10, 2019

if i recall correctly, the fix for me was the following change in the Fastfile

platform :ios do
  xcodeproj = './ios/MyApp.xcodeproj'
+ xcworkspace = './ios/MyApp.xcworkspace'

  ...

  desc 'Build the iOS app'
  lane :build do
    certificates
-   gym(scheme: 'MyApp', project: xcodeproj)
+   gym(scheme: 'MyApp', workspace: xcworkspace)
  end

  ...

@EYYCHEEV
Copy link

EYYCHEEV commented Nov 19, 2019

I had the same problem when I tried to run the app on my iPhone.
I used CocoaPods as a workaround.
I followed the suggestions on Stackoverflow

My environment:
react-native: 0.61
Xcode: 11.2.1

My steps to fix the issue:

  1. $ cd ios
  2. open YourProject.xcworkspace instead of YourProject.xcodeproj with Xcode
  3. Build and run the selected target

Voila, it works for me. Hope this helps. 🤞🏼

@rahulbhankar786
Copy link

thanks @EugeneYiminYan
this is perfect answer you can close this issue now

@0xinhua
Copy link
Author

0xinhua commented Nov 25, 2019

@rahulbhankar786 closed : )

@0xinhua 0xinhua closed this as completed Nov 25, 2019
@Jaroswaldo
Copy link

@rahulbhankar786 Well, it definitelly is not perfect answer. I saw in discussion people, who did not resolve issue by opening "xcworkspace" instead of "xcodeproj". I for instance am allways openning "workspace" file.

@Desintegrator
Copy link

same

@MrAlekhin
Copy link

thats definitely not the perfect answer. @M1sery did you read @EugeneYiminYan suggestion? more "perfect" would be "try to reopen xcode"

@0xinhua
Copy link
Author

0xinhua commented Feb 22, 2020

thats definitely not the perfect answer. @M1sery did you read @EugeneYiminYan suggestion? more "perfect" would be "try to reopen xcode"

I have reopen this issues.

@0xinhua 0xinhua reopened this Feb 22, 2020
@celwell
Copy link

celwell commented Feb 23, 2020

After much frustration, this 'fix' worked for me:
Delete the [YourApp]Tests target.
I don't think that be needed by most developers anyways.

@aydinmemis
Copy link

#20774 (comment)

@anmlkh
Copy link

anmlkh commented Feb 28, 2020

same issue for fastlane. updated react-native to 0.61.5 but it doesn't help
code of failing lane

lane :staging do
    app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)

    cocoapods(
      podfile: "ios/"
    )
    download_certificates(
      app_identifier: app_identifier,
      skip_development: true
    )
    get_push_certificate(app_identifier: app_identifier)
    version_bump(
      bump_type: "major"
    )
    build_app(workspace: "ios/project.xcworkspace", scheme: "project")
    upload_to_testflight(
      app_identifier: app_identifier,
    )
    clear_derived_data
    clean_build_artifacts
  end

fastlane version 2.142.0

@jaltin
Copy link

jaltin commented Mar 4, 2020

After much frustration, this 'fix' worked for me:
Delete the [YourApp]Tests target.
I don't think that be needed by most developers anyways.

Thank's @celwell! This fix worked for me too.

@anmlkh
Copy link

anmlkh commented Mar 4, 2020

I put 10th version of iOS everywhere where it was 9 or 11 (actually fastfile had 11) and now it works. So maybe it's just versions conflict

@hroland
Copy link

hroland commented Mar 17, 2020

I had the same issue, I updated my podfile with platform :ios, '11.0', but I forgot to set the target iOS version from 9 to 11 🙃

@merielleimpreso
Copy link

merielleimpreso commented Apr 9, 2020

Usually running pod install solves the problem on my side. Make sure to clean your build folder too: Product > Clean Build Folder before running or archiving your app.

@KiGi
Copy link

KiGi commented May 12, 2020

Same problem here as described originally, for us we get this issue when trying to do an archive (release) build only - builds work fine for simulator and device in debug.

I am running in a workspace, and tried deleting all targets except for the main one.

Quitting and resuming Xcode does nothing.

Deleting derived data, reinstalling cocopods, redoing pod install after deleting the Pods directory and Podfile.lock does nothing.

Any ideas? The repo we are trying to get a successful archive build for is in this directory of our repo:

https://github.com/namiml/react-native-nami-sdk/tree/master/examples/Basic

@hussainimdad004
Copy link

@celwell Thank you. It worked for me

After much frustration, this 'fix' worked for me:
Delete the [YourApp]Tests target.
I don't think that be needed by most developers anyways.

@haelbouhad
Copy link

@hroland Thank you. It worked for me

@tusharmutreja200
Copy link

tusharmutreja200 commented Jun 12, 2020

Hey guys, Any update for this issue, I am also facing this issue after upgrading from 0.57.8 to 0.62.
Any help will be really appreciated

@aesthytik
Copy link

I changed the build to new build system from legacy.

it worked 🤩👌🏻

@lifenautjoe
Copy link

Still having this issue... none of these solutions helped..

@safaiyeh safaiyeh added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available and removed Bug labels Aug 28, 2020
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@github-actions
Copy link

⚠️ Using Old Version
ℹ️ It looks like you are using an older version of React Native. Please upgrade to the latest version, and verify if the issue persists. If it does not, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the current release.

@DeadKuriel
Copy link

After much frustration, this 'fix' worked for me:
Delete the [YourApp]Tests target.
I don't think that be needed by most developers anyways.

It works for me. Thanks.

@safaiyeh
Copy link
Contributor

Hey all! Closing this issue as it is an old version of RN. If this occurs with the latest version feel free to open a new issue.

@thphuc
Copy link

thphuc commented Dec 12, 2020

In my case, I had to change the Deployment Info to iOS 11.0

image

@DanielGumbletonWood
Copy link

yarn upgrade-interactive --latest # update all dependancies
cd ios
pod update or pod install
cd ..
npx react-native run-ios

or also try

cd ios
pod deintegrate
pod install
cd ..
npx react-native run-ios

Also try deleting and reinstalling node modules before building the app

@facebook facebook locked as resolved and limited conversation to collaborators Oct 20, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests