ios - Swift 编译器错误 : Missing required modules;

标签 ios swift cocoapods

我想创建依赖于其他 pod 的自定义 pod。我有 podspec 文件

 ...
 s.source_files = "ios/**/*.{h,c,m,swift}"
 s.requires_arc = true

 s.dependency "UserSDK" 

UserSDK 是我想在我的自定义模块中使用的 pod。它有自己的依赖项,如 FirebaseCore , FirebaseMessaging UserSDK podspec

在我的 CustomModule.swift 文件中有
import Foundation
import UserSDK

要使用自定义库,请通过 pod 文件包含它;
# Uncomment the next line to define a global platform for your project
# platform :ios, '11.0'

target 'MyTarget' do

pod 'FBLazyVector', :path => "../modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../modules/react-native/'
pod 'React-Core', :path => '../modules/react-native/'
pod 'React-CoreModules', :path => '../modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../modules/react-native/'
pod 'React-RCTActionSheet', :path => '../modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../modules/react-native/'

pod 'CustomModule', :path => "../CustomModule"

end

错误 enter image description here

如果我添加 use_frameworks!在 podfile 中定位它可以工作,但是其他依赖项不起作用

最佳答案

podspec 文件中,缺少几个字段 我猜像

  • Deployment_Target
  • Source Filesinherit! :search_paths 之前在 Podfile 中使用 end

  • 引用:https://ronakshah.org/How-To-Make-A-Cocoapod-With-Dependencies
    对于您的特定错误,请在 podfile 中添加以下内容
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
    
    或引用:
    Xcode error: Missing required module 'Firebase'
    Swift app: “Missing required module” when importing framework that imports static library

    关于ios - Swift 编译器错误 : Missing required modules;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61871774/

    相关文章:

    javascript - 单击时的 window.location.assign 在 iOS 中不起作用

    objective-c - 如何覆盖点到像素 iOS 特异性并以正确的尺寸绘制图像?

    ios - 如何将 UICollectionView 添加到 inputAccessoryView

    swift - 如何在点击手势上为 UIImageView 制作动画?

    ios - pod 安装失败, react native 0.44

    ios - 如何将 C 控制台应用程序传输为统一的 native iOS 插件?

    ios - 将 textView 高度设置为等于 contentSize swift

    arrays - swift 错误 : Cannot convert value of type 'ArraySlice' to expected argument type

    Swift Firebase 查询 child 的 child

    Cocoapods 在 spec 文件中声明多个依赖项