Flutter For Mac M1 flutter doctor 遇见的问题

Flutter For Mac M1 flutter doctor 遇见的问题

刚刚接触flutter做一个记录,也分享给需要帮助的小伙伴

从flutter 官网上下载的sdk在我的电脑上不行,有以下错误:

  1. flutter doctor 时候没有什么反应 直接跳过了,需要使用 sudo flutter doctor
	sudo flutter doctor 	

但是会报错:

	CocoaPods installed but not working.
	
	You appear to have CocoaPods installed but it is not working.
	
	This can happen if the version of Ruby that CocoaPods was installed with
	
	is different from the one being used to invoke it.
	
	This can usually be fixed by re-installing CocoaPods.
	
	To re-install see
	
	https://guides.cocoapods.org/using/getting-started.html#installation for
	
	instructions.

开始以为是Ruby 和 CocoaPods 的版本冲突,一直在捣鼓这个问题,搞得我发疯。一般最新的就没有问题了

解决:
从GitHub上下载SDK:

git clone https://github.com/flutter/flutter.git -b stable

使用这个SDK就可以直接使用:

flutter doctor

但是我还遇到一个问题:

Creation failed, path = '/Users/xxx/.pub-cache/hosted-hashes/pub.flutter-io.cn' 
(OS Error: Permission denied, errno = 13)
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... 
(9 tries left)
Resolving dependencies... ^CError: Unable to 'pub upgrade' flutter tool. 
Retrying in five seconds... (8 tries left)

根据他的提示,删除这个缓存文件: /Users/xxx/.pub-cache,重新 flutter doctor,问题解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值