简体   繁体   中英

Xcode: library not found for -lPods

Having a react-native project, which won't build on target "Staging" since I've setup cocoapods and using xcworkspace file since then (needed for firebase integration of react-native-firebase ). When trying to build for taget "staging", I'll get this error:

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

在此输入图像描述

It works on debug, and (well at least it doesn't throw an error) when I archive the project.

I've having a "staging" target because of code-push. Using react-native at version 0.48.4 and Xcode 9 (created it following this guide , but before using cocoapods)

My podfile:

platform :ios, '9.0'

target 'xx' do
  #use_frameworks!

  # Pods 
  pod 'Firebase/Core'
  pod 'Firebase/Analytics'
  pod 'Firebase/Database'
  pod 'Firebase/Messaging'
  pod 'Firebase/Auth'
  pod 'Firebase/Storage'

end

Tried with and without use_frameworks! , cleaning project, deleted DerivedData, deintegrating and reintegrating pods.

What could cause this? (Please tell me if you need more information)

What worked for me:

  1. Deintegrated all pods using pod deintegrate (using enter link description here )
  2. pod install
  3. Removed [Project name] > Frameworks > Pods_[Project name].framework (which was red, but there are actually more files being red)
  4. Build succeeded

Was doing this with the help of this post . Thanks also to Maurice for trying to help me.

  1. Set your PODS_CONFIGURATION_BUILD_DIR of "staging" as "release" ${PODS_BUILD_DIR}/Release$(EFFECTIVE_PLATFORM_NAME).

  2. Check the Frameworks folder and remove red files.

I had this issue. In my case it was a react-native app added Firebase Analytics. As of July 2018, all apps must be built with iOS 11 per Apple: developer.apple.com/ios/submit/

Once I went to my General tab and scrolled down to Deployment Info / Deployment Target and changed it from 10.x which is what I was targeting, to 11.x - the app built/archived and I was able to submit.

check whether the SEARCH_PATHS is correct at Pods-XXXX.debug.xcconfig or Pods-XXXX.release.xcconfig

在此输入图像描述

LIBRARY_SEARCH_PATHS = $(inherited) "$(PODS_ROOT)/path/to/your folder"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM