我的项目在浏览器上运行良好,但是当我尝试添加平台iOS时,出现此错误(下面的代码)
显然问题是"cordova-plugin-googlemaps"
我已经删除了平台。然后添加了 CocoaPods ($ "sudo gem install cocoapods"),然后添加:
export LANG=en_US.UTF-8
但我仍然收到错误。
怎么了?你可以帮我吗?
谢谢。
--[cordova-plugin-googlemaps]------------------------
From version 2.4.5, the cordova-plugin-googlemaps uses CocoaPod.
No longer necessary com.googlemaps.ios plugin.
Automatic uninstalling com.googlemaps.ios plugin...
-----------------------------------------------------
Failed to install 'cordova-plugin-googlemaps': undefined
CordovaError: Promise rejected with non-error: '/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!':u001b[31m[!] You cannot run CocoaPods as root.u001b[39m (CLAide::Help)nnu001b[4mUsage:u001b[24mnn $ u001b[32mpodu001b[39m u001b[32mCOMMANDu001b[39mnn CocoaPods, the Cocoa library package manager.nnu001b[4mCommands:u001b[24mnn u001b[32m+ cacheu001b[39m Manipulate the CocoaPods cachen u001b[32m+ envu001b[39m Display pod environmentn u001b[32m+ initu001b[39m Generate a Podfile for the current directoryn u001b[32m+ installu001b[39m Install projectdependencies according to versions from an Podfile.lockn u001b[32m+ ipcu001b[39m Inter-process communicationn u001b[32m+ libu001b[39m Develop podsn u001b[32m+ listu001b[39m List podsn u001b[32m+ outdatedu001b[39m Show outdated project dependenciesn u001b[32m+ repou001b[39m Manage spec-repositoriesn u001b[32m+ setupu001b[39m Setup the CocoaPods environmentn u001b[32m+ specu001b[39m Manage pod specsn u001b[32m+ updateu001b[39m Update outdated project dependencies and create new Podfile.locknnu001b[4mOptions:u001b[24mnn u001b[34m--silentu001b[39m Show nothingn u001b[34m--versionu001b[39m Show the version of the tooln u001b[34m--verboseu001b[39m Show more debugging informationn u001b[34m--no-ansiu001b[39m Show output without ANSI codesn u001b[34m--helpu001b[39m Show help banner of specified commandntfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:47:in `run'ntfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'ntfrom /usr/local/bin/pod:22:in `load'ntfrom /usr/local/bin/pod:22:in `<main>'n'
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
[ERROR] An error occurred while running subprocess cordova.
cordova platform add ios --save exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
显然这cordova-plugin-googlemaps
新版本的cocoapods中不起作用。因此,使用旧版本的cocoapods,1.2.1对我有用。
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.2.1