Search code examples
iosreact-nativepod-install

JSON::ParserError - 451: unexpected token at '"Example/GoogleMapsDemos/Resources/'


When I do pod install, I get this information. How can i fix this please

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

Command

/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod install --repo-update

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 1.11.3
        Ruby : ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
    RubyGems : 3.3.11
        Host : macOS 12.3.1 (21E258)
       Xcode : 13.4 (13F17a)
         Git : git version 2.32.1 (Apple Git-133)
Ruby lib dir : /opt/homebrew/Cellar/ruby/3.1.2/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
               tsinghua-git-cocoapods - git - https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git @ 475bc08fcd69df2f292e39755b3880b545ea6c14

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
install! 'cocoapods', :deterministic_uuids => false

target 'tolernPowerBankApp' do
  # React Native Maps dependencies
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'tolernPowerBankAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
      end
    end
  end
end

Error

JSON::ParserError - 451: unexpected token at '"Example/GoogleMapsDemos/Resources/'
/opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/json/common.rb:216:in `parse'
/opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/json/common.rb:216:in `parse'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/json.rb:61:in `from_json'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:748:in `from_string'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:722:in `from_file'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source.rb:188:in `specification'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/resolver/lazy_specification.rb:37:in `specification'
/opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/delegate.rb:348:in `block in delegating_block'
/opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/delegate.rb:349:in `block in delegating_block'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:178:in `dependencies_for'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:18:in `block in dependencies_for'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:17:in `dependencies_for'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:809:in `block in group_possibilities'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:808:in `reverse_each'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:808:in `group_possibilities'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:779:in `possibilities_for_requirement'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:761:in `push_state_for_requirements'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:727:in `activate_new_spec'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>'

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

this is my dependencies


    "@ant-design/react-native": "^4.0.2",
    "@react-native-community/async-storage": "^1.10.1",
    "@react-native-community/cameraroll": "^4.0.0",
    "@react-native-community/cli-debugger-ui": "4.7.0",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/push-notification-ios": "^1.8.0",
    "@react-native-community/segmented-control": "^2.1.0",
    "@react-native-community/slider": "^3.0.0",
    "@react-native-community/viewpager": "^4.1.0",
    "@react-native-firebase/app": "^12.2.0",
    "@react-native-firebase/messaging": "^12.2.0",
    "@react-native-google-signin/google-signin": "^7.2.2",
    "@react-native-picker/picker": "react-native-picker/picker",
    "@react-navigation/compat": "^5.1.21",
    "@react-navigation/native": "^5.3.2",
    "@react-navigation/stack": "^5.3.5",
    "add": "^2.0.6",
    "card-validator": "^8.0.0",
    "has-flag": "^4.0.0",
    "ihakccinput": "^1.0.0",
    "moment": "^2.29.1",
    "path": "^0.12.7",
    "react": "16.11.0",
    "react-native": "0.68.2",
    "react-native-braintree": "^0.5.0",
    "react-native-camera": "^3.8.0",
    "react-native-facebook-login": "^1.6.2",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-htmlview": "^0.15.0",
    "react-native-image-crop-picker": "^0.31.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-looped-carousel": "^0.1.13",
    "react-native-maps": "^1.2.0",
    "react-native-modals": "^0.19.9",
    "react-native-pager-view": "^5.4.25",
    "react-native-payments": "^0.8.4",
    "react-native-payments-addon-stripe": "^0.4.0",
    "react-native-payments-cli": "^0.2.0",
    "react-native-popup-dialog": "^0.18.3",
    "react-native-push-notification": "^7.4.0",
    "react-native-ratings": "^7.2.0",
    "react-native-reanimated": "^1.8.0",
    "react-native-safe-area-context": "^1.0.0",
    "react-native-screens": "^2.7.0",
    "react-native-shadow": "^1.2.2",
    "react-native-shadow-cards": "^1.0.2",
    "react-native-storage": "^1.0.1",
    "react-native-svg": "^12.1.1",
    "react-native-swiper": "^1.6.0",
    "react-native-webview": "^9.4.0",
    "yarn": "^1.22.4"


Solution

  • Solved my problem by clearing the cache: rm -rf ~/.cocoapods/repos/trunk