iOS:无法构建模块 <framework-name>

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38717956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:49:26  来源:igfitidea点击:

iOS : Could not build module <framework-name>

iosobjective-cxcodemoduleframeworks

提问by Jayprakash Dubey

I've got Library from another team. I'm trying to use library in our project and while do so getting an error Could not build module 'Common Library' (name of framework)

我有另一个团队的图书馆。我正在尝试在我们的项目中使用库,但这样做时出现错误无法构建模块“通用库”(框架名称)

Screenshot 1

截图 1

Below are solutions that I worked on but didn't helped :

以下是我研究过但没有帮助的解决方案:

1. Delete Derived data content. Clean and Build.

2. Framework is added in 'Link binary with libraries' of Build phases.

3. While adding framework checkmarked : Target and Copy content to folder.

Even I tried this stackoverflow-linkbut didn't got any break-through!

甚至我也尝试过这个stackoverflow-link但没有任何突破!

screenshot 2

截图 2

screenshot 3

截图 3

The only thing that worked was deleting Objective-C bridging header pathin Swift compiler - code generation sectionof build settingsin Project.

唯一奏效的事情被删除Objective-C bridging header pathSwift compiler - code generation sectionbuild settings项目中。

However, thereafter I'm not able to get Common interface to create instance (i.e. Common dosen't appears in drop-down list)

但是,此后我无法获得 Common 接口来创建实例(即 Common 不会出现在下拉列表中)

Below is framework structure.

下面是框架结构。

Screenshot 6

截图 6

Any other fix?

有其他修复吗?

回答by lingyfh

you can try delete DerivedDatadir.

您可以尝试删除DerivedData目录。

where is DerivedData?(xcode 8)

DerivedData 在哪里?(xcode 8)

go to File > workspace Settings, you'll see DerivedData path.

转到文件 > 工作区设置,您将看到 DerivedData 路径。

DerivedData path in xcode 8

xcode 8 中的派生数据路径

enter image description hereenter image description here

在此处输入图片说明在此处输入图片说明

回答by Basheer

Check whether the framework you are integrating is supporting your project architecture.

检查您正在集成的框架是否支持您的项目架构。

To see the framework supported architecture, use Terminal and navigate to Framework folder.

要查看框架支持的架构,请使用终端并导航到框架文件夹。

use, "lipo -info myFramework.framework/MyFramework"

使用,“lipo -info myFramework.framework/MyFramework”

And, if you want to use the framework files in your project, check whether the files are available in Framework/Headers Folder.

并且,如果您想在项目中使用框架文件,请检查框架/标题文件夹中的文件是否可用。

Getting this error :

收到此错误:

Screenshot

截屏

Try, "file myFramework.framework/MyFramework" in Terminal

在终端中尝试“文件 myFramework.framework/MyFramework”

回答by Harrison Xi

I think you does not need to compile CommonLibrary.framework again. So you can try to remove it from Embedded Binarieslist. And make sure the path of CommonLibrary.framework is in your Framework Search Paths.

我认为您不需要再次编译 CommonLibrary.framework。因此,您可以尝试将其从Embedded Binaries列表中删除。并确保 CommonLibrary.framework 的路径在您的Framework Search Paths 中

回答by Andrew

I also had this problem: 1. My 'GoodLuck' framework had two headers: GoodLuck.h and GLAdder.h 2. Project which import this framework couldn't compile

我也有这个问题: 1. 我的“GoodLuck”框架有两个头文件:GoodLuck.h 和 GLAdder.h 2. 导入这个框架的项目无法编译

Solution: Import GLAdder.h in GoodLuck.h, rebuild the framework. It works.

解决方法:在GoodLuck.h中导入GLAdder.h,重新构建框架。有用。

回答by mackworth

I also had this problem, due to a typo in my GCC_PREPROCESSOR_DEFINITIONS, which therefore invalidated all of my code.

我也遇到了这个问题,因为我的 GCC_PREPROCESSOR_DEFINITIONS 中有一个错字,因此使我的所有代码无效。

First helpful warning was multiple "Macro Name must be an identifier" followed by multiple "Could not build module" messages.

第一个有用的警告是多个“宏名称必须是标识符”,然后是多个“无法构建模块”消息。