我有这个工作区(部分由此podfile生成)
# Podfile
platform :ios, '12.0'
use_frameworks!
workspace 'Wynton.xcworkspace'
def regular_pods
pod 'RxSwift', '~> 5.0'
pod 'RxCocoa', '~> 5.0'
pod 'SnapKit', '~> 5.0'
pod 'Starscream', '~> 3.0'
end
def testing_pods
pod 'Nimble', '~> 8.0'
pod 'RxBlocking', '~> 5.0'
pod 'RxTest', '~> 5.0'
end
# WYNTON
target 'Wynton' do
project 'Wynton.xcodeproj'
inherit! :search_paths
regular_pods
pod 'AudioKit', '~> 4.0'
# UNIT TESTS
target 'WyntonTests' do
inherit! :search_paths
regular_pods
testing_pods
end
end
# WYNTON HOST
target 'WyntonHost' do
project 'WyntonHost/WyntonHost.xcodeproj'
inherit! :search_paths
regular_pods
pod 'RealtimeWatchdog', '~> 1.0'
pod 'Watchdog', '~> 5.1'
end
工作区中有4个项目。
1. Pods (the cocoapods)
2. Mirga (my static c++ library) no dependencies
3. Wynton (my mixed framework, swift and objc) is depending on Mirga. Offers the root view controller and other ui stuff. A collection of things i want to share
4. Host (the application that uses Wynton and some Pods, only has an AppDelegate.swift file)
现在,当我尝试存档,测试或构建Wynton
框架时,一切都很好。
但是当我尝试运行WyntonHost
时,编译器将失败,并显示此错误。
<module-includes>:3:9: note: in file included from <module-includes>:3:
#import "../Mirga/AudioInputMapper.h"
^
/Users/mlostek/Projects/project/wynton/Wynton/WyntonPrivate/../Mirga/AudioInputMapper.h:4:9: error: 'MirgaFactory.h' file not found
#import "MirgaFactory.h"
^
<unknown>:0: error: could not build Objective-C module 'WyntonPrivate'
奇怪的是它从这里发生
import UIKit
import Watchdog
import Wynton //=> this is where the compile error is coming from
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// no storyboard, we create it manually
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = AppViewController() // AppViewController is from Wynton Framework
window?.makeKeyAndVisible()
return true
}
在Wynton
内部,我有一个名为WyntonPrivate
的内部模块。它包含这样的东西
module WyntonPrivate {
header "../Mirga/AudioInputMapper.h"
header "../Mirga/Factory/MirgaFactory.h"
header "../Mirga/Wrapper/MirgaWrapper.h"
header "../Mirga/Wrapper/PerformanceInterfaceWrapper.h"
export *
}
此文件在构建设置中设置为“专用模块映射文件”。
这是什么问题?