簡體   English   中英

Swift 預處理錯誤:預處理器表達式中的預期行結束

[英]Swift Preprocessing Error: Expected end of line in preprocessor expression

好吧,我正在解決一個關於cocoa pods' architecture 中重復符號的問題。 在接受的解決方案中使用post_install安裝 pod 后,我構建了 xcworkspace 項目,但遇到以下錯誤:

文件位置和錯誤的屏幕截圖。

錯誤是:預處理器表達式中的預期行結束。
在線: #if HAVE_FULLFSYNC
方法中: SyncFd(int fd, const std::string& fd_path)
文件的位置是:Pods/Pods/leveldb-library/env_posix.cc

我添加的引發這一系列問題的 Pod 是來自此處的“CodableFirebase”。

這是我的 Podfile:

platform :ios, '13.2'

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited), PodsDummy_Pods=SomeOtherNamePodsDummy_Pods'
        end
    end
end


target 'ShoeSwiperMenus' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ShoeSwiperMenus
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod ‘FirebaseUI/Auth'
pod 'FirebaseUI/Google'
pod 'FirebaseUI'
pod 'MaterialComponents/Buttons'
pod 'MaterialComponents/Buttons+Theming'
# pod 'MaterialComponents/schemes/Color'

pod 'Shuffle-iOS'
pod 'JGProgressHUD'
pod 'LBTATools'
pod 'CodableFirebase'

end

刪除post_install塊時,我回溯到我原來的錯誤是:
ld:架構 x86_64 的 202 個重復符號。
clang:錯誤:linker 命令失敗,退出代碼為 1(使用 -v 查看調用)

我在這里真的超出了我的深度......我什至不知道如何開始解決這個問題(谷歌上沒有)。 請幫忙!

我剛剛將你的 Podfile 添加到一個空項目中,得到了同樣的錯誤,然后刪除了post_install塊並且能夠無錯誤地構建。

因此,刪除post_install塊。 無論它應該解決什么問題,它都會創造這個問題。

另外,我建議添加inhibit_all_warnings! 到 Podfile。

暫無
暫無

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

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