标签: cocoapods

无法在 swift 项目中从 CocoaPods 导入 AFNetworking

在 Podfile 我

    pod 'AFNetworking', '~> 2.6.0'
Run Code Online (Sandbox Code Playgroud)

pod 更新,我使用 xcworkspace 打开项目。

一切都如我所愿,但是:

当我导入 AFNetworking 时,Xcode 提示 'No such module AFNetworking'

我搜索了这个问题的解决方案,并这样做:在“内置设置->用户标题搜索路径”中添加${SRCROOT}并选择递归。

但它没有用。Xcode 抛出相同的消息:'No such module AFNetworking'

ios afnetworking cocoapods swift

0
推荐指数
1
解决办法
4621
查看次数

如何安装特定版本的 cocoapods repo

这是我的Podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'RMQClient', '~> 0.8'
Run Code Online (Sandbox Code Playgroud)

当我尝试从 cocoapods 安装 repo 时pod install,它会为我安装一个新版本pod 'RMQClient'(例如 0.9)。

在另一个xcode project相同的Podfile,我做了一个pod update和它更新 pod repo 的 cocoapods:

安装 RMQClient 0.9.0(原为 0.8)

cocoapods当我进行更新时,如何防止更新 pod 存储库?如何强制安装我在Podfile.

ios cocoapods

0
推荐指数
1
解决办法
1973
查看次数

将 cocoapods 添加到使用cordova 6.5 创建的iOS 工作区

我正在使用 Apache Cordova 6.5,添加 iOS 平台并尝试在由cordova iOS 项目创建的工作区中使用 cocoapods。

当我运行命令时

吊舱安装

Xcode 项目无法编译,并且出现以下错误

diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Run Code Online (Sandbox Code Playgroud)

以下是我为解决此问题所做的步骤:

  • 创建一个新的 Cordova 6.5 项目

科尔多瓦创建应用程序1

  • 进入项目文件夹并添加iOS平台

光盘应用1/

科尔多瓦平台添加ios

  • 转到 iOS 项目文件夹并运行 pods

cd 平台/ios

豆荚初始化

吊舱安装

我尝试使用基本 podfile 和添加工作区名称的 podfile

# Uncomment the next line to define a global platform for your project
# …
Run Code Online (Sandbox Code Playgroud)

xcode ios cocoapods cordova

0
推荐指数
1
解决办法
2266
查看次数

从 pods 安装框架后,无法在 Swift 项目的类中导入

我已经在我的 Xcode 项目中通过 pod 文件安装了一些框架。我正在使用 Xcode 9.2。它已成功安装,但是,在尝试将该第三方框架导入到我的主类时,显示未找到此类模块。

甚至尝试了这么多次完全清理和重建。但是,仍然显示错误No such module found OR无法为 XLPagerTabStrip 加载底层模块

在框架搜索路径中,它显示在 PFA 下方。

在此处输入图片说明

xcode ios cocoapods swift

0
推荐指数
1
解决办法
6288
查看次数

FLUTTER [!] 在 `Pods/.symlinks/plugins/helloworld/ios` 中找不到 `helloworld` 的 podspec

我已经使用颤振有一段时间了。有一次当我去编译时,我刚收到这个错误。我的代码似乎没有任何问题。我试图重新安装我的 cocoapods,但这并没有改变任何东西。谁有想法?

  Launching lib/main.dart on iPhone X in debug mode...
Skipping compilation. Fingerprint match.
Running pod install...
CocoaPods' output:
?
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (`arm64`)

Finding Podfile changes
  A helloworld
  - Flutter
  - camera

Fetching external sources
-> Fetching podspec for `Flutter` from `Pods/.symlinks/flutter/ios`
-> Fetching podspec for `camera` from `Pods/.symlinks/plugins/camera-0.1.2/ios`
-> Fetching podspec for `helloworld ` from `Pods/.symlinks/plugins/helloworld/ios`
[!] No podspec found for `helloworld ` in `Pods/.symlinks/plugins/helloworld/ios` …
Run Code Online (Sandbox Code Playgroud)

dart cocoapods flutter

0
推荐指数
1
解决办法
7236
查看次数

无法在 iOS 项目中安装 Pod

我一直在尝试更新 cocoapod。在此期间,我更新了 Ruby 和 RVM。现在,当我pod init在我的新 ios 项目中尝试时,显示以下内容

Traceback (most recent call last):  
2: from /usr/local/bin/pod:23:in `<main>'
1: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
Run Code Online (Sandbox Code Playgroud)

我检查了以下内容,

  1. ruby --version

    ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16]
    
    Run Code Online (Sandbox Code Playgroud)
  2. rvm list rubies

    =* ruby-2.5.1 [ x86_64 ]
    
    # => - current
    # =* - current && default
    #  * - default
    
    Run Code Online (Sandbox Code Playgroud)

ruby macos ios cocoapods

0
推荐指数
2
解决办法
3548
查看次数

从 podspec 或 info.plist 中检索 pod 版本到代码中

我创建了自己的 pod,其中包含 s.version = "0.4.7" 的 podspec 文件,我希望以编程方式将其写入代码,因此每当应用程序运行时,它都会将 pod 版本发送到服务器。

获取 pod 版本的另一个地方是从下面的 plist 文件,即“捆绑版本字符串”0.4.7

在此处输入图片说明

我试过使用,let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String但它从 Apps Info.plist 文件中获取版本。

plist ios cocoapods swift swift4

0
推荐指数
1
解决办法
2151
查看次数

打开安装了两个pod的Xcode项目

我正在尝试将Moltin和Firebase pod添加到我的应用程序中.我知道如果我想打开文件(只安装了一个pod),我需要从.xcworkspace文件中打开它,而不是使用.xcodeproj文件.

如果我安装了多个pod(以及两个.xcworkspace文件),我必须打开哪个文件?

xcode frameworks cocoapods

0
推荐指数
1
解决办法
278
查看次数

Xcode/Swift:显示我添加到 CocoaPod 的“打印”

我使用的是 Swift 5、Xcode 10 和 iOS 12。

我将“FilesProvider”(单击)作为 CocoaPod 添加到我的项目中并且它正在工作,但现在我想测试一些东西,为此我向print库的一个 .swift 文件中添加了几个s。

我是如何做到的:

  • Pods - Pods - FilesProvider在项目导航器中导航到
  • 在那里打开正确的 .swift 文件
  • 添加prints
  • 解锁文件(Xcode 询问我是否想要这样做)并保存它
  • 在模拟器中运行我的应用程序

不过,添加的prints 并未打印在控制台中。我很确定我将它们添加到我的应用程序正在使用的库中的函数中。

我是否必须使用任何特殊设置来显示printCocoaPod的s?

xcode ios cocoapods swift

0
推荐指数
1
解决办法
989
查看次数

错误:无法使用 Swift 5 构建 Objective-C 模块“Firebase”

我想在 Swift 5 中使用 Firebase,但出现错误消息。

无法构建 Objective-C 模块“Firebase”

我尝试了以下页面上的所有解决方案,但无法解决:

错误:无法构建 Objective-C 模块“Firebase”

https://github.com/firebase/quickstart-ios/issues/672

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
    return true
  }
}
Run Code Online (Sandbox Code Playgroud)

我期望构建成功,但实际上构建失败。

构建错误消息是:

找不到“FirebaseCore/FirebaseCore.h”文件无法构建Objective-C模块“Firebase”

并且,xcode 在以下位置显示错误消息

import Firebase
Run Code Online (Sandbox Code Playgroud)

在 AppDelegate.swift 中

cocoapods firebase ios12 xcode10 swift5

0
推荐指数
1
解决办法
5446
查看次数

标签 统计

cocoapods ×10

ios ×7

swift ×4

xcode ×4

afnetworking ×1

cordova ×1

dart ×1

firebase ×1

flutter ×1

frameworks ×1

ios12 ×1

macos ×1

plist ×1

ruby ×1

swift4 ×1

swift5 ×1

xcode10 ×1