简体   繁体   English

与其他框架和主应用程序使用相同的框架时出现错误

[英]Getting error when have same framework used with another framework and main application

My application consist of the main app, 2 custom frameworks and 1 framework filled with objects. 我的应用程序由主应用程序,2个自定义框架和1个充满对象的框架组成。 I want to use the object framework in the main app and both of the children frameworks but I am getting Class is implemented in both One of the two will be used. 我想在主应用程序和两个子级框架中使用对象框架,但是我都在两个类中都实现了类。 Which one is undefined. 哪一个未定义。 error 错误

One of my extra frameworks is in swift and the other is in objective c but that shouldn't make a difference. 我的一个额外框架很快,而另一个目标是目标c,但这没什么不同。

It's the common problem, when including frameworks, that contains the same submodule. 当包含框架时,常见的问题是包含相同的子模块。 Duplicate error happens because you have the same symbols inside your binary, so, when you include both, linker fails. 由于二进制文件中包含相同的符号,因此会发生重复错误,因此,当您同时包含两个符号时,链接器将失败。

The are several ways to solve this. 有几种解决方法。

  1. Rename classes inside "parent" framework, which you include, with another domain prefix (the common way to do so, if you have access to source code) 用另一个域前缀重命名您所包含的“父”框架中的类(如果可以访问源代码,通常的方法是重命名)

  2. Also, if you can build all this frameworks separately, maybe this link could help (it's git submodule feature, which also helpful when you have to deal with Pods, i think it could give an idea, how to solve your issue) 另外,如果您可以分别构建所有这些框架,则此链接可能会有所帮助(它是git子模块功能,当您必须处理Pods时,该功能也很有用,我认为它可以提供一个思路,如何解决您的问题)

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM