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

Created on 3 May 2017  Β·  13Comments  Β·  Source: CocoaPods/CocoaPods

pod install
Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Command

/usr/local/bin/pod install
Report

What did you do?

What did you expect to happen?

What happened instead?

Stack

CocoaPods : 1.2.1
Ruby : ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
RubyGems : 2.6.7
Host : Mac OS X 10.12.3 (16D32)
Xcode : 8.2.1 (8C1002)
Git : git version 2.10.1 (Apple Git-78)
Ruby lib dir : /usr/local/Cellar/ruby/2.3.1/lib
Repositories : master - @ fatal: Not a git repository (or any of the parent directories): .git
sdo-specs - [email protected]:iOS/Specs.git @ 9585c339b0892bffc65e85d5fe26ee59b2df84ed
Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.2.0
cocoapods-try : 1.1.0
Podfile

source '[email protected]:iOS/Specs.git'

platform:ios, '8.0'
inhibit_all_warnings!
GKitVersion = '0.16.14'

target 'gmm' do
    pod 'BXFoundation','1.0.7'
    pod 'GChat4GMM','1.7.61'
    pod 'GKit/Privacy',GKitVersion
    pod 'GKit/TableCells',GKitVersion
    pod 'GKit/GetPhotos',GKitVersion
    pod 'GKit/ScrollPhotoView',GKitVersion
    pod 'GKit/GReportMTA',GKitVersion
    pod 'GKit/ImageScroll',GKitVersion
    pod 'IFXRefresher', '1.1.2'
    pod 'GBao','2.0.12'
    pod 'AFNetworking', '3.1.0'
    pod 'SDWebImage', '3.7.3'
    pod 'HTCopyableLabel','0.0.7'
    pod 'BlocksKit','2.2.5'
    pod 'MJRefresh','3.1.12'
    pod 'Bugly', '2.3.1'
    pod 'WeexSDK'
    pod 'GMMLogin', '1.0.3'
    pod 'GHomePush', '1.0.6'
    pod 'FDStackView', '1.0'
    pod 'ActionSheetPicker-3.0', '2.2.0'
    pod 'SSZipArchive', '1.7'

end

Error

JSON::ParserError - A JSON text must at least contain two octets!
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/json/common.rb:156:in `initialize'
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/json/common.rb:156:in `new'
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/json/common.rb:156:in `parse'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification/json.rb:46:in `from_json'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:567:in `block in from_string'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:559:in `chdir'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:559:in `from_string'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification.rb:542:in `from_file'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/specification/set.rb:45:in `specification'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source.rb:265:in `search'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.2.1/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:362:in `create_set_from_sources'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:332:in `find_cached_set'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:305:in `specifications_for_dependency'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:123:in `search_for'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:221:in `block in sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:215:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:215:in `sort_by'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:215:in `sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:52:in `block in sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:69:in `with_no_such_dependency_error_handling'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/delegates/specification_provider.rb:51:in `sort_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:165:in `initial_state'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:106:in `start_resolution'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolution.rb:64:in `resolve'
/usr/local/lib/ruby/gems/2.3.0/gems/molinillo-0.5.7/lib/molinillo/resolver.rb:42:in `resolve'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/resolver.rb:77:in `resolve'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer/analyzer.rb:742:in `block in resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer/analyzer.rb:739:in `resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer/analyzer.rb:76:in `analyze'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:236:in `analyze'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:149:in `resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:110:in `install!'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/command/install.rb:41:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=A+JSON+text+must+at+least+contain+two+octets%21&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

pod search not work JSON ParserError

5172 [closed] [7 comments]

5 weeks ago

awaiting input

Most helpful comment

Facing same with "pod install", and this is worked for me:

  1. rm -rf "${HOME}/Library/Caches/CocoaPods"
  2. rm -rf "pwd/Pods/"
  3. pod update

Please backup the respective directories before running "rm" commands

All 13 comments

I had tried the way in the follow problem:"Try deleting it and searching again" ,but it does't effect.
https://github.com/CocoaPods/CocoaPods/issues/5172 .

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1:

I've got this problem too...
Whenpod install or pod search for some repo spec not found locally😫

and can't update cocoapods by sudo gem install cocoapods:

ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (https://gems-ruby-china.b0.aicdn.com/quick/Marshal.4.8/cocoapods-1.3.1.gemspec.rz)

and I've also tried brew update && brew upgrade openssl

It happen to me when i use 'pod search'.
I hope it can show me the framework current version number that i searched.
But 'pod search' tell me a error occurred.

This is my error log:

Command

/usr/local/bin/pod search YYCache --ios

Stack

   CocoaPods : 1.3.1
        Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
    RubyGems : 2.6.13
        Host : Mac OS X 10.12.6 (16G29)
       Xcode : 9.2 (9C40b)
         Git : git version 2.14.3 (Apple Git-98)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : coding-make-pod-repo - [email protected]:dao/make-pod-repo.git @ e03e4bac90481a93eb317a167d51b011785338fa
               master - https://github.com/CocoaPods/Specs.git @ 96179add06fce3114aef64c9257abb984c1ac783
               Specs -  @ fatal: Not a git repository (or any of the parent directories): .git

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

platform :ios, '8.0'
use_frameworks!
  target 'xxxxx' do
      pod 'AFNetworking'
      pod 'SDWebImage'
      pod 'SVPullToRefresh'
      pod 'Masonry'
      pod 'UMengSocial'
      pod 'UMengAnalytics-NO-IDFA'
      pod 'YYCache'
      pod 'YYModel'
      pod 'RMQClient', '~> 0.10.0'
      pod 'KVOController'
      pod 'IQKeyboardManager'
      pod 'ZLPhotoBrowser'
  end
target 'xxxxxx' do
    pod 'AFNetworking'
    pod 'SDWebImage'
    pod 'SVPullToRefresh'
    pod 'Masonry'
    pod 'UMengSocial'
    pod 'UMengAnalytics-NO-IDFA'
    pod 'YYCache'
    pod 'YYModel'
    pod 'RMQClient', '~> 0.10.0'
end

Error

JSON::ParserError - A JSON text must at least contain two octets!
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.3.1/lib/cocoapods-core/source/manager.rb:251:in `stored_search_index'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.3.1/lib/cocoapods-core/source/manager.rb:187:in `updated_search_index'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-1.3.1/lib/cocoapods-core/source/manager.rb:118:in `search_by_name'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-search-1.0.0/lib/cocoapods-search/command/search.rb:87:in `local_search'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-search-1.0.0/lib/cocoapods-search/command/search.rb:63:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.3.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

Solution for this problem when "pod search"
It's in segiddins's comment

Facing same with "pod install", and this is worked for me:

  1. rm -rf "${HOME}/Library/Caches/CocoaPods"
  2. rm -rf "pwd/Pods/"
  3. pod update

Please backup the respective directories before running "rm" commands

Facing same with "pod install", and this is worked for me:

  1. rm -rf "${HOME}/Library/Caches/CocoaPods"
  2. rm -rf "pwd/Pods/"
  3. pod update

Please backup the respective directories before running "rm" commands

This worked for me, but I did need delete Podfile.lock

Facing same with "pod install", and this is worked for me:

  1. rm -rf "${HOME}/Library/Caches/CocoaPods"
  2. rm -rf "pwd/Pods/"
  3. pod update

Please backup the respective directories before running "rm" commands

this worked for me

For me helps downgrade CocoaPods version:
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.7.5

For me helps downgrade CocoaPods version:
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.7.5

Hi, @Jason-Chan @geek-ibrar @talhamuhammadashraf
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.7.5
this worked for me, but I get an error when I compile and run the project, such as: (-1: Unable to load contents of file list: '/Users/ling/Program/ios/lover/Pods/Target Support Files/Pods-Lover/Pods-Lover-frameworks-Debug-input-files.xcfilelist' (in target 'Lover')). (XCode 11.3.1,MacOS 10.14.6),However when I re-install cocoapods 1.9.1, it also show the error-- "JSON::ParserError - A JSON text must at least contain two octets! "

The following instructions are also useless to me!!
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "pwd/Pods/"
pod update

any one can help me what should I do next? Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iosdev-republicofapps picture iosdev-republicofapps  Β·  3Comments

gerchicov-bp picture gerchicov-bp  Β·  3Comments

dawnnnnn picture dawnnnnn  Β·  3Comments

marzapower picture marzapower  Β·  3Comments

pronebird picture pronebird  Β·  3Comments