[英]IOS Module not found error when adding Objective-C framework projects using CocoaPods as a module in Swift project
I have scenario where i have couple of SDKs and a test app. 我有几个SDK和一个测试应用程序的场景。 Here is the example.
这是例子。
SDKCore - “Objective-C Framework” SDKCore- “ Objective-C框架”
SDKUI - “Objective-C Framework” SDKUI- “ Objective-C框架”
pod 'SDKCore', :path => '../SDKCore'
and with flag 'use_frameworks' pod 'SDKCore', :path => '../SDKCore'
并使用标志'use_frameworks'将SDKCore添加为依赖项 @import SDKCore;
@import SDKCore;
Code 码
#import "SDKUIViewController.h"
@import SDKCore;
@interface SDKUIViewController ()
@end
@implementation SDKUIViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[SDKClass hitTest];
self.view.backgroundColor = [UIColor redColor];
}
@end
SDKTestSwift SDKTestSwift
pod 'SDKCore', :path => '../SDKCore'
and with flag 'use_frameworks' pod 'SDKCore', :path => '../SDKCore'
并使用标志'use_frameworks'将SDKCore添加为依赖项 pod 'SDKUI', :path => '../SDKUI'
and with flag 'use_frameworks' pod 'SDKUI', :path => '../SDKUI'
并带有标志'use_frameworks' pod 'SDKUI', :path => '../SDKUI'
将SDKUI添加为依赖项。 Problem is when i compile SDKTestSwift I'm getting Module SDKCore not found
a compile error on one of the files from SDKUI (See attached) 问题是当我编译SDKTestSwift时,我得到的
Module SDKCore not found
其中一个文件上Module SDKCore not found
编译错误(请参阅附件)
Really got stuck here. 真的卡在这里了。 Thanks a lot in advance.
非常感谢。
You can download the sample project from here . 您可以从此处下载示例项目 。
Sorry, I actually have misunderstood you from the start, your issue lying in your pod, not project, this happen because you didn't state that the SDKUI
depend on SDKCore
, thats why you cant use any code from SDKCore
抱歉,实际上我从一开始就误解了您的问题,您的问题在您的pod中,而不是项目中,这是因为您没有声明
SDKUI
依赖于SDKCore
,这就是为什么您不能使用SDKCore
任何代码的SDKCore
To fix this, simply add s.dependency 'SDKCore'
in your SDKUI.podspec
and run pod install
again, then it works 为了解决这个问题,只需添加
s.dependency 'SDKCore'
你SDKUI.podspec
和运行pod install
一遍,然后它的工作原理
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.