美文网首页
iOS解决“The ‘Pods-XXX‘ target has

iOS解决“The ‘Pods-XXX‘ target has

作者: 少年你这是喜脉啊 | 来源:发表于2022-05-17 18:09 被阅读0次

    Objective-C项目中的podfile引入了swift库后编译时报了下面的错误:
    Undefined symbol: static Swift.String.+ infix(Swift.String, Swift.String) -> Swift.String

    解决方案:

    在podfile引入的swift库之前加入use_frameworks!

    use_frameworks!
    pod 'XXXX'

    再次执行pod install之后又报了下面的错误:

    The ‘Pods-XXX‘ target has transitive dependencies that include statically linked binaries:
    (/Users/XXXX/XXXX/XXXX/XXXX.framework)

    解决方案:

    在podfile中加入下面的代码:

    pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    end

    再次执行pod install之后成功。

    引用swift库时需要把#import改为@import

    @import XXXX;

    相关文章

      网友评论

          本文标题:iOS解决“The ‘Pods-XXX‘ target has

          本文链接:https://www.haomeiwen.com/subject/wumnurtx.html