skip to Main Content

So I am new to mac. I installed Flutter, Android Studio, XCode, CocoaPods (with sudo gem install cocoapods) and every other required packages. The app ran successfully on Android but I get this error while trying to run on iOS:

JSON::ParserError - Failed to parse JSON at file: '~/.cocoapods/repos/trunk/Specs/a/d/d/GoogleMaps/6.0.0/GoogleMaps.podspec.json'.

    unexpected token at '"SwiftExample/GoogleMapsSwiftDemos/Swift/AppDelegate.s'

This (seems like the most important) part of the long error log. (Check this issue for the full log).

I tried: flutter clean, reinstalling Cocoapods, tried using VPN as suggested in the issue above, none worked.

2

Answers


  1. Chosen as BEST ANSWER

    So, as the error log suggested, there's an issue with the json file (it's incomplete).

    The plan was then to make Cocoapods redownload the folder (and the files therein).

    Using Finder:

    Open Finder, then press Shift + Command + G, and paste the path (to the JSON's parent folder) ~/.cocoapods/repos/trunk/Specs/a/d/d/GoogleMaps (GoogleMaps in this case), into the dialog box, then press Enter. This will take you directly to the directory. Rename the directory to say GoogleMaps_Old (I couldn't delete it) and run sudo gem install cocoapods again. It should download the folders again. Then try to run the project again.

    This worked for me.


  2. same error I also have

    JSON::ParserError - Failed to parse JSON at file: '/Users/pearlorganisation/.cocoapods/repos/trunk/Specs/9/1/0/gRPC-Core/1.62.5/gRPC-Core.podspec.json'.
    
    unexpected token at '"
    '
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search