简体   繁体   中英

can't install realm with CocoaPods

I did pod init and wrote RealmSwift in Podfile.

I'm using 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

I got JSON parserError like this

JSON::ParserError - A JSON text must at least contain two octets!

What should I do to fix the ParseError? And I could install SwiftDate. I can't install only RealmSwift.

follow these

  • rm -rf "${HOME}/Library/Caches/CocoaPods"
  • rm -rf "pwd/Pods/"
  • pod update

Please backup the respective directories before running "rm" commands

If not work, delete Podfile.lock and run rm commands then run pod init and pod install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM