当前位置: 首页 > news >正文

flutter配置国内镜像

git clone -b master https://mirrors.tuna.tsinghua.edu.cn/git/flutter-sdk.git

设定方式如下:

export FLUTTER_STORAGE_BASE_URL="https://mirrors.tuna.tsinghua.edu.cn/flutter"
export PUB_HOSTED_URL="https://mirrors.tuna.tsinghua.edu.cn/dart-pub"
export FLUTTER_GIT_URL="https://mirrors.tuna.tsinghua.edu.cn/git/flutter-sdk.git"

若希望长期使用 TUNA 镜像:

echo 'export FLUTTER_STORAGE_BASE_URL="https://mirrors.tuna.tsinghua.edu.cn/flutter"' >> ~/.bashrc
echo 'export PUB_HOSTED_URL="https://mirrors.tuna.tsinghua.edu.cn/dart-pub"' >> ~/.bashrc

在编译android项目时,flutter还会从 https://storage.googleapis.com/download.flutter.io 下载Java程序库,您可以在 Android 项目目录下的 build.gradle 中添加下面一行下载源,从而使用TUNA镜像。

allprojects {repositories {google()jcenter()maven { url 'https://mirrors.tuna.tsinghua.edu.cn/flutter/download.flutter.io' }}
}
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PATH=$Flutter_SDK/bin:$PATH
flutter doctor初始化一般还需要安装
sudo pacman -S clang cmake ninja
/packages/flutter_tools/gradle/flutter.gradle
或者
/packages/flutter_tools/gradle/src/main/groovy/flutter.gradle

修改repositories里面的内容为:

maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/central' }

1、找到flutter sdk的文件目录,打开flutter\packages\flutter_tools\lib\src\http_host_validator.dart

2、将https://maven.google.com/
修改为
https://dl.google.com/dl/android/maven2/
https://maven.aliyun.com/repository/google/

http://www.wxhsa.cn/company.asp?id=5576

相关文章:

  • 微信小程序 live-player 无声音
  • 栈的妙用:如何优雅地处理括号匹配难题 (C语言版)
  • 食品包装 AI 视觉检测技术:原理、优势与数据应用解析
  • 电流探头的常见应用场景
  • WebRTC编码过载检测与帧率适应机制分析报告
  • PC桌面应用开发选择
  • 陈燕的项目启动笔记
  • C++面试宝典八股文之什么是封装、继承、多态(附面试宝典八股文PDF)
  • 无需复杂正则:SLS 新脱敏函数让隐私保护更简单高效
  • PLC结构化文本设计模式——适配器模式(Adapter Pattern)
  • DRAM、SRAM、NAND Flash、NOR Flash、EEPROM、MRAM存储器你分得清吗?
  • 【初赛】最短路 次短路 k短路 - Slayer
  • hyperv 安装 ubuntu 压缩磁盘
  • 【实战记录】使用 wp-cli 恢复/修改 WordPress 密码
  • Spring Boot 下 Druid 连接池:多维度优化打造卓越性能
  • 讨好型人格自救指南:重建健康自我与关系
  • vue3使用vue3-pdf-app预览pdf文档
  • 使用lvgl/lv_port_pc_visual_studio在PC上运行LVGL模拟器
  • 深入解析:Spring Boot 深入剖析:SpringApplicationRunListener
  • Hutool 调用第三方接口报错
  • 丑东西经济学:全面分析
  • 深入浅出 Java 多线程:从线程生命周期到并发安全
  • 儿童无屏幕对讲机 Bunny 融资百万美元;腾讯会议推出 AI 托管:先行听会、代听多会、全程记录丨日报
  • Python turtle 海龟画图入门指南
  • uni-app中v-if使用”异常”
  • 如何创建可引导的 macOS Tahoe 安装介质
  • 二叉树遍历
  • Python Socket网络编程(3)
  • 实用指南:有关gitlab14.x版本在内网环境下无法添加webhooks的解决方法
  • 强类型、类型安全