簡體   English   中英

存檔CocoaPods依賴項以發布到App Store時出錯

[英]Error archiving a CocoaPods dependency for release to App Store

我在移動應用程序中使用以下庫為用戶提供入門教程: ephread / Instructions

一切工作正常,直到我最近將XCode更新到版本10。更新之后,我確保將所有依賴項更新為使用支持Swift 4.2的版本。

對於有問題的庫,這些更改在Cocoapods版本中尚不可用,因此我使用了庫作者建議的特定分支,如下所示:

pod 'Instructions', :git => 'https://github.com/ephread/Instructions.git', :branch => 'swift4'

當我在Debug中編譯並運行時,一切正常。 但是,當我嘗試發布一個存檔版本時,出現以下錯誤(為簡潔起見,我僅包括我認為與之相關的內容)。

<unknown>:0: error: fatal error encountered while reading from module 'Instructions'; please file a bug report with your project and the crash log
<unknown>:0: note: compiling as Swift 4.1.50, with 'Instructions' built as Swift 4.2.1 (this is supported but may expose additional compiler issues)

*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
could not deserialize type for '_': could not deserialize type for 'windowLevel': declaration is not a nominal type
Cross-reference to module 'UIKit'
... Level

0  swift                    0x000000011114159a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x0000000111140d4e SignalHandler(int) + 302

...

3.  While deserializing SIL vtable for 'OverlayManager' in module 'Instructions'
error: Abort trap: 6

這是我做錯了還是我無法修復的庫問題?

我在libs上也遇到了類似的問題,但沒有更新到Swift4.2

將此添加到Podfile為我解決了這個問題

swift4Targets = ['POD NAME']
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            if swift4Targets.include? target.name
                config.build_settings['SWIFT_VERSION'] = '4.0'
                else
                config.build_settings['SWIFT_VERSION'] = '4.2'
            end
        end
    end
end

暫無
暫無

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

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