FormidableLabs / react-native-app-auth

React native bridge for AppAuth - an SDK for communicating with OAuth2 providers
https://commerce.nearform.com/open-source/react-native-app-auth
MIT License
2.01k stars 438 forks source link

Library not found for -lAppAuth #973

Open vic2tee4u opened 4 months ago

vic2tee4u commented 4 months ago

Issue

I just recently upgraded my company's React native from 0.68.0 to 0.73.6. When attempting to build, I run into the issue above alongside

Library not found for -lAppAuth Linker command failed with exit code 1 (use -v to see invocation)

We used to be on react-native-app-auth version 6.4.3 but since the issue started, I moved up to 7.1.3 but to no avail. We are also using x-code 15. I am on Mac M2 (already using xcodeworkspace). We have bee stuck on this for about three weeks now.


Environment

System: OS: macOS 14.4.1 CPU: (12) x64 Apple M2 Pro Memory: 11.58 MB / 16.00 GB Shell: version: 3.2.57 path: /bin/bash Binaries: Node: version: 20.13.1 path: ~/.nvm/versions/node/v20.13.1/bin/node Yarn: version: 1.22.21 path: /opt/homebrew/bin/yarn npm: version: 10.5.2 path: ~/.nvm/versions/node/v20.13.1/bin/npm Watchman: version: 2024.04.08.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.15.2 path: /usr/local/bin/pod SDKs: iOS SDK: Platforms:

fant0mex commented 4 months ago

Hi @vic2tee4u, I've managed to build an app on iOS using the react native and react-native-app-auth versions you have listed. Assume you've tried the usual rm -rf Pods/ Podfile.lock ; pod install?

vic2tee4u commented 4 months ago

Yes, I've gone through that. I also noticed that this issue has happened in the past for other folks here but it never seems to have a resolve.

fant0mex commented 4 months ago

Seems people have had some success with changing the deployment target Would this perhaps be a viable option? Or upgrading to the latest versions of both this lib and react native?

vic2tee4u commented 4 months ago

Because we are already in xcode 15 (Apple mandated this) and the minimum target cannot be below 12.4, that is not a viable option for us.

fant0mex commented 4 months ago

Any joy with removing $(inherited) from "Library Search Paths" in Project Build Settings?

vic2tee4u commented 4 months ago

I will give that a try now and see if that helps

vic2tee4u commented 4 months ago

Just tried but got a failed

Screenshot 2024-05-16 at 7 32 20 AM
carbonrobot commented 4 months ago

Which install method did you use for installing the native dependencies? Ref: https://github.com/FormidableLabs/react-native-app-auth?tab=readme-ov-file#install-native-dependencies

vic2tee4u commented 4 months ago

I used the first method. Cocoapod.

carbonrobot commented 4 months ago

Check your pod versions in the ios folder and ensure you have all the native modules installed. An easy way to do this is run pod outdated from the ios folder in terminal/bash/etc. You are looking specifically for AppAuth-iOS pod.

In general, the error for Library not found for {X} is your local React Native project is unable to find the dependency due to either a project misconfiguration and/or dependency/build cache. The RNAA library does not perform that linking for you, so all we can offer is advice.

Usually when you run into this situation its best to first check the dependencies, then check your linker configuration. Finally, perform a clean of the project build and dependency output.

fant0mex commented 4 months ago

If all else fails, could also try the nuclear approach

vic2tee4u commented 4 months ago

Let me give the above two options a try and report back.

vic2tee4u commented 4 months ago

Gave the above two approaches a try and they still yield the same error. pod outdated didn't show AppAuth as outdated.

fant0mex commented 4 months ago

@vic2tee4u Just wondering if you used the diff generated by https://react-native-community.github.io/upgrade-helper/ to upgrade?

vic2tee4u commented 4 months ago

Yes I used the helper

taha200 commented 2 months ago

I am getting this issue? Any update on this?

zibs commented 2 months ago

I've just tried this a couple of times on the latest RN with both bridgeless enabled and disabled, and it seems to be working, so please provide more information for anyone who is still having an issue.

You can also check in Xcode to see if the AppAuth library is showing in your pods.

Screenshot 2024-07-24 at 8 57 32 AM