【问题标题】:Cocoapod "pod spec lint" CompileSwift returned an unsuccessful exit codeCocoapod “pod spec lint” CompileSwift 返回了一个不成功的退出代码
【发布时间】:2018-11-29 23:14:52
【问题描述】:

我正在尝试创建我的第一个 Cocoapod,并且到目前为止我的 pod 设置得很好,但是当我尝试 lint 或 push 时,我得到了一堆构建错误。 包含 swift 代码的 pod 使用 sqlite3 库。 我已将它链接到 Xcode pod 项目的构建阶段,我可以从那里构建良好,但是当在我的 pod 上运行 pod repo push 时,它会尝试构建并失败,并出现一堆“使用未解析的标识符”错误,大概是因为没有依赖。 我还在我的 podspec 文件中添加了s.library = 'sqlite3',但没有运气。

这是一个sn-p

- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:51:16: error: value of type 'String' has no member 'isValid'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:61:16: error: use of unresolved identifier 'sqlite3_bind_null'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:61:55: error: use of unresolved identifier 'SQLITE_OK'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:62:41: error: use of unresolved identifier 'sqlite3_errmsg'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:67:16: error: use of unresolved identifier 'sqlite3_bind_int'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:67:76: error: use of unresolved identifier 'SQLITE_OK'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:68:41: error: use of unresolved identifier 'sqlite3_errmsg'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:73:16: error: use of unresolved identifier 'sqlite3_bind_text'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:73:95: error: use of unresolved identifier 'SQLITE_OK'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:74:41: error: use of unresolved identifier 'sqlite3_errmsg'
- ERROR | [iOS] xcodebuild:  SQLift/SQLift/Classes/PreparedStatement.swift:79:16: error: use of unresolved identifier 'sqlite3_bind_double'

我仍然是创建 pod 的新手,我不太确定如何解决这个问题,我们将不胜感激。

【问题讨论】:

    标签: swift xcode sqlite cocoapods


    【解决方案1】:

    --no-clean 选项添加到pod spec lint 命令以获得一个Xcode 工作区,您可以在其中重现和调试构建问题。

    【讨论】:

    • 查看生成的工作区,我注意到它缺少一些我后来添加的导入。那时我意识到 lint 从 podspec 文件中定义的 url 而不是工作目录中提取源。我推送了我的更改,标记了它并且它起作用了。非常感谢!
    猜你喜欢
    • 2017-01-01
    • 1970-01-01
    • 2015-11-21
    • 1970-01-01
    • 2019-10-02
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    相关资源
    最近更新 更多