我想在我的XCode工作区中使用嵌入式Firebase框架创建私有框架,以便在此工作区中的两个应用程序中使用 .

我的工作区结构是:

MyApps.xcworkspace

---- FirebaseKit.xcodeproj

---- ---- FirebaseKit

---- ---- ---- Manager.swift

---- ----产品介绍

---- ---- ---- FirebaseKit.framework

        • 构架

---- ---- ---- FirebaseAnalytics.framework

---- ---- ---- FirebaseDatabase.framework

---- ---- ---- FirebaseStorage.framework

---- MyApp1.xcodeproj

---- ---- MyApp1

---- ---- ---- AppDelegate.swift

        • 构架

---- ---- ---- FirebaseKit.framework

---- MyApp2.xcodeproj

---- ---- MyApp2

---- ---- ---- AppDelegate.swift

        • 构架

---- ---- ---- FirebaseKit.framework

我的FirebaseKit.Manager.swift文件是:

import Firebase

public struct Manager {
    public static func configure() {
        FIRApp.configure()
    }
}

然后我构建了FirebaseKit - Succeded

MyApp1.AppDelegate.swift(和MyApp2.AppDelegate.swift)代码是:

import FirebaseKit     //<-- error is here "Missing required module 'Firebase'"

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionKey: Any]?) -> Bool {
        FirebaseKit.Manager.configure()
        return true
    }
}

当我尝试构建MyApp1或MyApp2时,出现错误“Missing required module'Firebase'”

我试过两种方式:

  • 在FirebaseKit中使用Cocoapods

  • 没有Cocoapods(手动添加Firebase框架)

是否可以在其他框架中嵌入框架以在相同(或不同)的xcworkspace中使用?我试图找到文档或其他答案,但没有运气 .