美文网首页
Module '**' was created for inco

Module '**' was created for inco

作者: 老P打码 | 来源:发表于2021-03-24 17:55 被阅读0次

    Module '**' was created for incompatible target arm64-apple-ios8.0: /User/xx/xx

    场景:Xcode12下,真机running成功,模拟器运行时如上报错。

    初步猜测:

    根据错误提示,看到arm64条件反射,初步猜测是静态库/动态库未加入模拟器架构导致报错。

    使用 lipo -info xx.framework/xx 命令检查对应的module的架构,以及使用 file xx.framework/xx,发现报错的库是支持模拟器x86_64架构的动态库。

    查找资料,寻找解决方案

    https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios/63955114#63955114

    参考上面文章处理方法得到解决
    解决方法如下两步:

    • 第一步,对应的target下的Build Setting下找到 Excluded Architecture,选择Debug,将Any SDK 切换为 Any iOS Simulator SDK,添加 arm64 配置。
    • 第二步,主项目 Podfile 文件配置
    post_install do |installer|
      installer.pods_project.build_configurations.each do |config|
        config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
      end
    end
    

    寻找原因

    • Xcode升级12后,项目默认不包含模拟器的类型:x86_64(64位处理器的模拟器)

    附:
    XCODE12 在使用模拟器(SIMULATOR)时编译错误的解决方法
    iOS14适配和Xcode12模拟器运行兼容

    相关文章

      网友评论

          本文标题:Module '**' was created for inco

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