pod 'MaterialComponents/TextFields' 安装错误
Posted
技术标签:
【中文标题】pod \'MaterialComponents/TextFields\' 安装错误【英文标题】:pod 'MaterialComponents/TextFields' error in installingpod 'MaterialComponents/TextFields' 安装错误 【发布时间】:2020-04-15 17:46:14 【问题描述】:这是我的 pod 文件
平台:ios,'9.0'
目标“MaterialUi”做 # MaterialUi 的 Pod pod 'MaterialComponents/TextFields' 结尾 我尝试了所有可能的解决方案
sudo gem 安装 cocoapods
pod 存储库更新
每次我得到这个! ## 报告
你做了什么?
您预计会发生什么?
发生了什么?
堆栈
CocoaPods : 1.9.1
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
RubyGems : 3.0.3
Host : Mac OS X 10.15.3 (19D76)
Xcode : 11.3.1 (11C504)
Git : git version 2.21.1 (Apple Git-122.3)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
插件
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.1.0
cocoapods-trunk : 1.4.1
cocoapods-try : 1.1.0
播客文件
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MaterialUi' do
# Pods for MaterialUi
pod 'MaterialComponents/Buttons'
end
错误
JSON::ParserError - 416: unexpected token at '"components/Collections/src/'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/specification/json.rb:61:in `from_json'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/specification.rb:742:in `from_string'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/specification.rb:716:in `from_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/source.rb:186:in `specification'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver/lazy_specification.rb:37:in `specification'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver/lazy_specification.rb:29:in `subspec_by_name'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:362:in `block in specifications_for_dependency'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:362:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:362:in `specifications_for_dependency'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:165:in `search_for'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:267:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:267:in `sort_by'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:53:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:70:in `with_no_such_dependency_error_handling'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:52:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:288:in `initial_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:210:in `start_resolution'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:168:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1065:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1063:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
―――模板结束―――――――――――――――――――――――――――――――――――――――― ――――――――――――――――――――――
[!] 哦不,发生了错误。
搜索与您类似的现有 GitHub 问题: https://github.com/CocoaPods/CocoaPods/search?q=416%3A+unexpected+token+at+%27%22components%2FCollections%2Fsrc%2F%27&type=Issues
如果不存在,请使用上面显示的模板在以下位置创建一个工单: https://github.com/CocoaPods/CocoaPods/issues/new
请务必先阅读贡献指南,详细了解如何正确提交工单: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
不要忘记匿名化任何私人数据!
正在寻找关于 cocoapods/cocoapods 的相关问题... 没有发现类似问题。要创建新问题,请访问: https://github.com/cocoapods/cocoapods/issues/new
[!] 因为没有指定平台,所以在目标MaterialUi
上自动分配平台iOS
和版本13.2
。请在您的 Podfile 中为此目标指定一个平台。见https://guides.cocoapods.org/syntax/podfile.html#platform
。
【问题讨论】:
你找到解决办法了吗? 【参考方案1】:在 Xcode 11.3.1 (Swift 5) 上也有同样的问题,但我使用“ActivityIndicator”组件,而不是“Buttons”,看起来 MaterialComponents-pod 的最后一个版本坏了。 我找到的解决方案,您必须使用组件的最后可用版本号,如下所示:
pod 'MaterialComponents/ActivityIndicator', '~> 107.4'
【讨论】:
【参考方案2】:我遇到了同样的问题。无法从任何地方寻求帮助。然后我附加标签并为我工作。示例:pod 'MaterialComponents/TextFields', '~> 119.4.0' 希望这对你有用。
【讨论】:
【参考方案3】:你可以试试。它对我有用
pod 'MaterialComponents', :git => 'https://github.com/material-components/material-components-ios', :branch => ENV['DEFAULT_BRANCH']
【讨论】:
以上是关于pod 'MaterialComponents/TextFields' 安装错误的主要内容,如果未能解决你的问题,请参考以下文章