存档CocoaPods依赖项以发布到App Store时出错

时间:2018-12-14 12:24:59

标签: ios swift

我在移动应用程序中使用以下库为用户提供入门教程: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

这是我做错了还是我无法修复的库问题?

1 个答案:

答案 0 :(得分:0)

我在未更新到Swift4.2的库中遇到了类似的问题

将此内容添加到Podfile中为我解决了此问题

import pygame as pg
from threading import Thread


def update():
    running = True
    while running:
        for event in pg.event.get():
            if event.type == pg.QUIT:
                running = False
        display.fill(bgColor)
        pg.display.update()
        clock.tick(60)
    pg.quit()


ww, hh = 800, 600
bgColor = (255, 255, 255)

pg.init()
display = pg.display.set_mode((ww, hh))
clock = pg.time.Clock()
Thread(target=update).start()