ios - CocoaPods 与 Realm

标签 ios cocoapods realm

我正在尝试使用 CocoaPods 安装 Realm。我以前做过没有问题,但现在我遇到了错误。下面我发布了我的 Podfile 代码和我在终端中返回的错误

播客文件

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
Uncomment this line if you're using Swift
use_frameworks!


target 'Htlaeh' do

    pod 'RealmSwift'

end

target 'HtlaehTests' do

    'pod RealmSwift'

end

target 'HtlaehUITests' do

    pod 'RealmSwift'

end

错误

[!] Invalid `Podfile` file: syntax error, unexpected tCONSTANT, expecting end-of-input
target 'Htlaeh' do
              ^. Updating CocoaPods might fix the issue.

#  from /Users/Cody/Desktop/Htlaeh/Podfile:7
#  -------------------------------------------
#  
>  target 'Htlaeh' do
#  
#  -------------------------------------------

最佳答案

我想我可以看到 CocoaPods 不满意的两个潜在语法错误:

  1. Uncomment this line if you're using Swift 需要被注释掉(它指的是它下面的行。;))

  2. Tests 目标中,它应该是 pod 'RealmSwift'。撇号现在在 'pod' 前面。

请尝试更正这两个语法问题,如果不能解决问题,请告诉我。 :)

关于ios - CocoaPods 与 Realm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33165615/

相关文章:

ios - 在 Base ViewController 中展开 Optional 值时意外发现 nil

ios - 如何修复 Failed to fetch platform cordova-ios@~4.4.0

ios - 没有这样的模块 Firebase

swift - 将 JSON 字典保存到 Realm Swift

ios - 如何在 iOS 上使用代码截取屏幕截图?

ios - 通过cocoapod安装CorePlot 2.0失败

swift - 添加到 TableView 时 Realm 项会出现两次

ios - 为什么编译成静态库后找不到bridge文件?

Swift:使用 Realm 过滤记录

java - Android Realm Java 0.82.1 ArrayIndexOutOfBoundsException