React-native-app-auth: linker command failed - ld: library not found for -lAppAuth

Created on 17 Jun 2018  路  21Comments  路  Source: FormidableLabs/react-native-app-auth

screen shot 2018-06-17 at 16 11 00
screen shot 2018-06-17 at 16 11 05

ld: warning: directory not found for option '-L/Users/brkrtp/Library/Developer/Xcode/DerivedData/burak
-ceqbfdnxrzunipektpsftfekkcjw/Build/Products/Debug-iphoneos/AppAuth'
ld: library not found for -lAppAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Most helpful comment

@Jonny993 awesome! 馃帀

.xcworkspace vs .xcodeproj can be super confusing especially if you're new to xcode 馃槵 - but the rule of thumb in this case is that if you're using pods, you have to open .xcworkspace.

Closing this issue as although you weren't the original author of the issue, I get the feeling the solution is the same.

All 21 comments

Have you run react-native link? If you have and you're still getting the error, try running the example app and compare its config to yours on Xcode.

same i just open Example from xcode and build it and this error
but if i do with react-native run-ios all good

Also i have notice this line

Include libAppAuth as a linked library for your target (in the "General -> Linked Framework and Libraries" section of your target).

but i cant find libAppAuth

Hmm, I can't reproduce it. Which version of Xcode are you on?

Version 9.3
I did a lot of things but those might help
I did two things put

  1. Pods.xcodeproj in libraries
  2. did rm -rf ~/Library/Caches/CocoaPods
  3. pod install

And it helps but any way my ci still fails appcenter
logs_390.zip

you can try do git clone from scratch i think you should be able to reproduce

currently faced with dev pass but on archive fails with this error

i think the problem with xcode version and pod
in latest xcode and lates pod all should be good but i will recheck it

Hi, I've just released v3.0.0 of this library, which should fix some weirdness with iOS integration. Could you please try again with the latest version? Note that the code you need to add to AppDelegate has changed.

updates on this? same error!

@Jonny993 have you run react-native link? What version of React Native and this library are you running?

image

react-native link done, all is working fine when I run the app in the IOS simulator, but problems comes up when I try to build with xcode!

"react-native": "0.56.0"
"react-native-app-auth": "^3.1.0"

Tell me if you need anything else

@Jonny993 are you sure you've opened the.xcworkspace file (instead of the .xcodeproj which doesn't see pods)?

@Jonny993 are you sure you've opened the.xcworkspace file (instead of the .xcodeproj which doesn't see pods)?

If I try to open the workspace I don't have any command for build or anything like that.

However, digging more in the problem I found out that XCODE can't find lib named "AppAuth" in the project, so I went to the folder to see which libraries are builded

image

As I thought, no "AppAuth" lib is present, so I went in the build settings of the project, I searched for "Search Paths" and found out that for debugging and releasing the "Library Search Paths" was pointing to something "wrong" (AppAuth) so I changed the paths for pointing to the correct named lib but error is the same.

Here you can see

image

Any tip on this would be gold..

Ok so, huge update!
I reverted all the updates done yesterday and tried to do the following:

  • react-native run-ios

Got sured that everything was building and working fine on IOS Simulator

  • opened up .xcworkspace file instead of .xcodeproj one
  • this time, I could navigate the xcode project inside the workspace (I couldn't yesterday, don't know why, something was messing up the entire project)
  • added team and provisioning profile from target, general tab
  • added iOS Developer from project, Code Signing Identity to everything

image

  • build with CMD+R command the app directly on device
  • inserted password when prompted
  • done!

So just to clarify.. I was having some kind of problems accessing the .xcworkspace and so I tried to do the build on the .xcodeproj, which gave the errors above.
Cleaned everything up, restarting from yesterday, following the react native guide on how to build the app on device and boom, everything was working fine

@Jonny993 awesome! 馃帀

.xcworkspace vs .xcodeproj can be super confusing especially if you're new to xcode 馃槵 - but the rule of thumb in this case is that if you're using pods, you have to open .xcworkspace.

Closing this issue as although you weren't the original author of the issue, I get the feeling the solution is the same.

@Jonny993 are you sure you've opened the.xcworkspace file (instead of the .xcodeproj which doesn't see pods)?

thanks

Hey,

I was facing same kind of issue with Microsoft Outlook login SDK integration.I was using Cocoapods to install the libraries.I am getting below error,

ld: library not found for -lMSGraphSDK
clang: error: linker command failed with exit code 1 (use -v to see invocation)

FYI : Podfile is : pod 'MSGraphSDK'
pod 'MSGraphSDK-NXOAuth2Adapter' and XCode version is 10.2.1

Any help would be appreciated !!
Thanks.

Thank you @Jonny993! it worked for me too!

I still get the same error. I tried everything. It has been a day I'm on this. Please can you help? The solution above did'nt help

Was this page helpful?
0 / 5 - 0 ratings