React-native-app-auth: library not found for -lAppAuth only for release build (works fine in debug)

Created on 3 Sep 2019  路  9Comments  路  Source: FormidableLabs/react-native-app-auth

Issue

Hi,

I was using this library from long time.
It is working fine for me till I was using React-Native 0.59.X
As soon as i started using latest react-native 0.60.5 (latest for now) i am facing weird issue.
In debug mode for iOS device is' working fine as expected. But when i try to release the app from xcode. I am getting a linker error for AppAuth library.

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

My podfile as follows,

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

target '<AppName>' do
  # Pods for <AppName>
  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 '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 'AppAuth', '>= 0.94'
  pod 'RNAppAuth', :path => '../node_modules/react-native-app-auth/ios/RNAppAuth.podspec'
  pod 'react-native-html-to-pdf', :path => '../node_modules/react-native-html-to-pdf'
  pod 'react-native-print', :path => '../node_modules/react-native-print'
  pod 'react-native-webview', :path=> '../node_modules/react-native-webview'
  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
  pod 'RNDeviceInfo', :path=> '../node_modules/react-native-device-info'
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  pod 'react-native-signature-capture', :path => '../node_modules/react-native-signature-capture'

  target '<AppName>Tests' do
    inherit! :search_paths
    # Pods for testing
  end
   use_native_modules!
end

Also my Linked Binary with Libraries has only one item of libPod-<AppName>.a

Also added all configuration as told in getting started for AppDelegate.h & AppDelegate.m\


Environment

"react": "16.8.6",
"react-native": "0.60.5",
"react-native-app-auth": "^4.4.0",

Xcode : 10.3
Cocoa Pods: 1.7.5

  • Identity Provider: Okta
  • Platform experiencing the issue on: iOS
  • Using Expo?: No

Please help me to resolve the issue. Also let me know if you need any extra information.
Thanks in advance.

Most helpful comment

Im having this problem can someone help :(

All 9 comments

Hi @cjadhav 馃憢
I wonder if there is some unexpected behaviour due to the manual linking step. Could you try installing the release candidate of the library yarn add react-native-app-auth@next - it supports autolinking.

Hi @kadikraman,

Thanks for the reply.

with next version it updated pod file with pod 'react-native-app-auth', :path => '../node_modules/react-native-app-auth'
But gives same error as -lAppAuth Library not found

It will be good if we get updated example of ios for RN>=60.X.
It's only updated for android for now.

Hi @cjadhav - sorry for the delay. The Example app is now updated to use RN 60+.

Then the autolinking is working correctly, there should be nothing added to the Podfile, but when you run pod install in the ios directory after installing this library, it should add the following to the Podfile.lock

  - react-native-app-auth (5.0.0-rc4):
    - AppAuth (= 1.2.0)
    - React

Hope this helps!

Im having this problem can someone help :(

@tiffanym19 I faced this error when had to change platform :ios, from '10.0' to '11.0'
didn't use react-native-app-auth directly but likely used as peerDependency of google-signin

couldn't fix this and had to rollback to platform :ios, '10.0'

@tiffanym19 I faced this error when had to change platform :ios, from '10.0' to '11.0'
didn't use react-native-app-auth directly but likely used as peerDependency of google-signin

couldn't fix this and had to rollback to platform :ios, '10.0'

How did you rollback to 10.0 iOS platform?

I got the same issue with

react-native: 0.63.2
xcode: 11.7
macos Catalina: 10.15.6

I had searched around for 2 days, but haven't found the solution.

I having the same issue

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

same here

Was this page helpful?
0 / 5 - 0 ratings