ios - 无法使用 CocoaPods 安装领域
问题描述
我做了 pod init 并在 Podfile 中编写了 RealmSwift。
我正在使用 Swift5、Xcode 11.3.1、cocoaPod 1.9.1、ruby 2.3.0
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'project' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for project
pod 'RealmSwift'
target 'projectTests' do
inherit! :search_paths
# Pods for testing
end
target 'projectUITests' do
# Pods for testing
end
end
我得到了这样的 JSON parserError
JSON::ParserError - A JSON text must at least contain two octets!
我应该怎么做才能修复 ParseError?我可以安装 SwiftDate。我不能只安装 RealmSwift。
解决方案
遵循这些
- rm -rf "${HOME}/Library/Caches/CocoaPods"
- rm -rf "密码/Pods/"
- 吊舱更新
请在运行“rm”命令之前备份相应的目录
如果不起作用,请删除 Podfile.lock 并运行 rm 命令,然后运行 pod init 和 pod install
推荐阅读
- typescript - 找不到规则“@typescript-eslint/no-redeclare”的定义
- python - 如何按到点的距离过滤带有 LineString 字段的对象?
- svg - 如何将内联 SVG 嵌入到 XSL 文件中?
- javascript - 如何将 Javascript 类翻译成 ScalaJS
- list - Scheme eval 简单规避
- thymeleaf - 如何在 Thymeleaf 中应用 elvis 算子?
- mysql - 使用 docker-sync for MySQL / Databases 进行本地开发?
- javascript - JS,firebase.auth() 在全局上下文中不起作用,但在函数内部起作用?- firebase.Auth 不是函数
- ubuntu - 如何为 ext4 和 NTFS 分区上的相同文件获取相同的文件大小?
- python - 查找字符串中包含数字的列