“重新定义模块……"为模拟器构建时 [英] "Redefinition of module ..." when building for simulator

查看:26
本文介绍了“重新定义模块……"为模拟器构建时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 iOS xcode 项目,当我将 Generic iOS Device 选为我的目的地时,该项目构建良好.但是,当我选择任何模拟器选项时,我的构建失败,并出现许多 Redefinition of module 'abcde'iOS 11.4/usr/include/module.modulemap 中定义的每个模块都有一个错误.

I have an iOS xcode project that builds fine when I have Generic iOS Device selected as my destination. However, when I select any of the simulator options I the build fails with many Redefinition of module 'abcde', one error for every module defined in iOS 11.4/usr/include/module.modulemap.

重复定义来自 Simulator - iOS 11.4/usr/include/module.modulemap.我梳理了我的工作区/项目设置,没有发现对模拟器的引用.所有部署目标都是iOS 11.4.

The duplicate definitions are coming from Simulator - iOS 11.4/usr/include/module.modulemap. I've combed through my workspace/project settings and found no reference to the simulator. All the deployment targets are iOS 11.4.

看来,当我为模拟器构建时,它同时包含了平台和模拟器模块.如何指定其中一个?

It appears that when I build for the simulator it is including both the platform and simulator modules. How can I specify one or the other?

这个问题在添加 cocoapods 和 swift 代码大约一天后突然出现,但我不知道它是否相关.(Pod 的 sdk/deployment 目标也是 iOS 11.4,swift 版本是 4(Socket.IO 除外,它使用 3)).

This problem popped up out of the blue about a day after adding cocoapods and swift code but I don't know if it is related. (The sdk/deployment targets for the pods are also iOS 11.4 and swift version is 4 (except for Socket.IO which is using 3)).

我的 pods 项目正在使用生成的模块映射(我根本没有对其进行编辑):

My pods project is using the generated modulemap (I haven't edited it at all):

framework module Pods_MyProjectName {
  umbrella header "Pods-MyProjectName-umbrella.h"

  export *
  module * { export * }
}

我在谷歌上一遍又一遍地搜索这个问题,但没有找到任何解决方案.我已经尝试清理和重建,删除Library/Developer/Xcode/DerivedData文件夹的内容,删除pod的modulemap文件,注释掉pod的modulemap文件的每一行,删除所有写的代码自从问题开始以来……我感觉自己找错了地方.

I've googled this problem over and over and haven't been able to find any solution for it. I've tried cleaning and rebuilding, deleting the contents of the Library/Developer/Xcode/DerivedData folder, deleting the pod's modulemap file, commenting out each line of the pod's modulemap file, removing all the code written since the problem began... I have the feeling that I'm looking in all the wrong places.

推荐答案

我在使用其他 Pod 时遇到了同样的问题.我认为这个问题与也显式导入的递归依赖有关.我尝试了和你一样的所有事情,虽然唯一帮助我的是关闭 xcode,运行

I had the same issue with other pods. I assume the issue has to do with recursive dependecnies that are also imported explicitly. I tried all the same things as you did, although the only thing that helped me was to close xcode, run

pod deintegrate
pod install

并重建.

这篇关于“重新定义模块……"为模拟器构建时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆