Sam*_*Sam 5 ios cocoapods swift
我想创建依赖于其他 Pod 的自定义 Pod。我有 podspec 文件
...
s.source_files = "ios/**/*.{h,c,m,swift}"
s.requires_arc = true
s.dependency "UserSDK"
Run Code Online (Sandbox Code Playgroud)
UserSDK 是我想在自定义模块中使用的 pod。它有自己的依赖项 FirebaseCore,例如FirebaseMessaging UserSDK podspec
在我的 CustomModule.swift 文件中有
import Foundation
import UserSDK
Run Code Online (Sandbox Code Playgroud)
要使用自定义库,请通过 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
Run Code Online (Sandbox Code Playgroud)
如果我添加use_frameworks!到 podfile 中的目标,它可以工作,但其他依赖项不起作用
在文件中,我想缺少podspec几个字段
Deployment_Target
Source Files
用inherit! :search_paths在Podfile之前end。
参考: https: //ronakshah.org/How-To-Make-A-Cocoapod-With-Dependencies
\n并针对您的具体错误添加以下内容podfile
pod \'Firebase/Core\'\npod \'Firebase/Messaging\'\nRun Code Online (Sandbox Code Playgroud)\n或者参考:\n Xcode 错误:缺少必需的模块“Firebase”
\nSwift 应用程序:\xe2\x80\x9c 导入静态库的框架时缺少所需模块\xe2\x80\x9d
\n| 归档时间: |
|
| 查看次数: |
4791 次 |
| 最近记录: |