簡體   English   中英

RN + Cocoapods = 找不到 -lPods-XXX 的庫

[英]RN + Cocoapods = library not found for -lPods-XXX

我覺得這個問題已經被一次又一次地提出,但我發誓我測試了互聯網上看到的每一個解決方案,但它仍然在發生。

基本上我將我的 React Native 項目轉移到使用 cocoapods。 請參閱下面的我的 Podfile。 當我安裝 pod 時,我將“libPods-XXX.a”添加到我的“Link Binary With Librairies”構建階段。 我猜這就是 Cocoapods 的工作原理?

但是當 libPods-XXX.a 在那里時,我無法構建,總是得到錯誤“找不到 -lPods-XXX 的庫”。 如果我手動刪除它,它工作正常。 但是接下來的 pod install 將添加它。

我已經嘗試過的:

  • 我正在使用工作空間文件
  • 對於 XXX 項目和安裝的每個 pod,“僅構建活動架構”在調試中設置為是,在我的其他方案中設置為否。
  • 我的目標中的“其他鏈接器標志”設置為“$(繼承)”
  • 我的目標中的“圖書館搜索路徑”設置為“$(繼承)”
  • 已經多次嘗試解體和重新安裝,節點模塊也是如此

我真的沒有想法了。 任何人都可以指出我可能缺少的其他東西嗎?

謝謝

播客文件

platform :ios, '9.0'

target :XXX do
    pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
    pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
    pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
    pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
    pod 'React', :path => '../node_modules/react-native/'
    pod 'React-Core', :path => '../node_modules/react-native/'
    pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
    pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
    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-Core/RCTWebSocket', :path => '../node_modules/react-native/'

    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 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
    pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
    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'

  # Pods for XXX
  pod 'react-native-signature-capture', :podspec => '../node_modules/react-native-signature-capture/react-native-signature-capture.podspec'
  pod 'RNFS', :path => '../node_modules/react-native-fs'
  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
  pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'
  pod 'RNI18n', :path => '../node_modules/react-native-i18n'
  pod 'SentryReactNative', :path => '../node_modules/react-native-sentry'
  pod 'react-native-version-number', :path => '../node_modules/react-native-version-number'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'CodePush', :path => '../node_modules/react-native-code-push'
  pod 'react-native-webview', :path => '../node_modules/react-native-webview'
  pod 'react-native-background-upload', :path => '../node_modules/react-native-background-upload'
  pod 'react-native-document-picker', :path => '../node_modules/react-native-document-picker'
  pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
end

回答我自己的問題:

在我們的例子中,這個錯誤是由於我們的 Xcode 項目中有多個配置(登台、生產、開發)。

在構建設置$BUILT_PRODUCTS_DIR/../$CONFIGURATION-$PLATFORM_NAME添加到我們目標的庫搜索路徑解決了這個問題!

打印

您是否在該字段中插入此行?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM