ThingsBoard部署APP问题-GitHub无法访问
flutter以window平台方式运行时报错:
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Resolving dependencies...
Git error. Command: `git clone --mirror https://github.com/thingsboard/esp_provisioning_softap C:\Users\Administrator\AppData\Local\Pub\Cache\_temp\dir86ecccb0`
stdout:
stderr: Cloning into bare repository 'C:\Users\Administrator\AppData\Local\Pub\Cache\_temp\dir86ecccb0'...
fatal: unable to access 'https://github.com/thingsboard/esp_provisioning_softap/': Failed to connect to github.com port 443 after 21099 ms: Could not connect to serverexit code: 128
Failed to update packages.Exited (69).
解决办法:修改 hosts 文件(适用于 DNS 解析问题)
1. 找到 hosts 文件位置:
- Windows: C:\Windows\System32\drivers\etc\hosts
- macOS/Linux: /etc/hosts
2. 添加 GitHub 相关 IP(可通过https://ipaddress.com/查询最新 IP):
140.82.114.4 github.com
199.232.69.194 github.global.ssl.fastly.net
3. 刷新 DNS 缓存:
- Windows: ipconfig /flushdns
- macOS: sudo killall -HUP mDNSResponder
- Linux: sudo systemctl restart network-manager
必须要刷新DNS设置,否则仍然不能访问。另外重启电脑后马上访问也会失败,过一会自动可以访问。目前按以上方式解决了windos 2 次。