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
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 sayGoogleMaps_Old
(I couldn't delete it) and runsudo gem install cocoapods
again. It should download the folders again. Then try to run the project again.This worked for me.
same error I also have