私有 CocoaPod - 即使安装了 pod,也找不到模块

问题描述

我创建了一个新框架 CocoaPod,这是我的“podspec”文件的副本:

Pod::Spec.new do |s|

# 1
s.platform = :ios
s.ios.deployment_target = '12.0'
s.name = "IdFramework"
s.summary = "IdFramework is a framework containing functionality."
s.requires_arc = true

# 2
s.version = "0.1.0"

# 3
s.license = { :type => "MIT",:file => "LICENSE" }

# 4 - Replace with your name and e-mail address
s.author = { "Idan Israel" => "myEmail" }

# 5 - Replace this URL with your own GitHub page's URL (from the address bar)
s.homepage = "link"

# 6 - Replace this URL with your own Git URL from "Quick Setup"
s.source = { :git => "{link to my framework on Github}",:tag => "#{s.version}" }

# 7
s.framework = "UIKit"
s.dependency 'Firebase'

# 8
"IdFramework/**/*"

# 9

# 10
s.swift_version = "4.2"

end

'podspec' 上传成功,我可以在 GitHub 上看到来源。

我创建了一个新项目,我试图在其中使用我新创建的 CocoaPodPodfile 的外观如下:

# Uncomment the next line to define a global platform for your project
# platform :ios,'12.0'

source 'https://github.com/CocoaPods/Specs.git'
source '{Link to my source code on GitHub}'

target 'TestingPods' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for TestingPods
  pod 'IdFramework','~> 0.1.0'

end

这是我在框架内的代码

import Foundation
import Firebase

public class FirebaseConfig {
    public static func setupFirebase() {
        let arguments = ProcessInfo.processInfo.arguments as [String]
        var plistFileName = "GoogleService-Info-"

        if let environment = arguments.first?.split(separator: " ").last {
            plistFileName += environment
            
            guard let plistPath = Bundle.main.path(forResource: plistFileName,ofType: "plist"),let options =  FirebaSEOptions(contentsOfFile: plistPath) else {
                return
            }
            
            if FirebaseApp.app() == nil{
                FirebaseApp.configure(options: options)
            }
        }
    }
}

CocoaPod 及其所有依赖项均已正确安装,我还可以在 IdFramework 中的 Pods 下看到 Xcode - 但是,当我尝试导入 {{1} } - 我收到一条 IdFramework 错误消息。

我尝试了以下方法

  1. No such module 'IdFramework' 然后是 pod deintegrate
  2. 检查 pod install 下的 Pods,并构建两个项目。
  3. 确保 Manage SchemesiOS version 都匹配。
  4. 彻底清理我的项目并重建。

以上都不适合我,问题仍然存在。可能是什么问题?

解决方法

将#8 替换为:

s.source_files  = "IdFramework/**/*"

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...