Flutter 配置国内镜像,加速项目加载!

Flutter 运行配置

Flutter项目创建后,设置国内镜像地址。

1.国内使用阿里地址
rust 复制代码
// 文件位置 android/build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/central/' }
        maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
        maven { url 'https://maven.aliyun.com/repository/apache-snapshots/' }
        maven { url 'https://maven.aliyun.com/repository/google/' }
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/central/' }
        maven { url 'https://maven.aliyun.com/repository/public/' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
        maven { url 'https://maven.aliyun.com/repository/apache-snapshots/' }
        maven { url 'https://maven.aliyun.com/repository/google/' }
    }
}
2.指定项目java地址(有些android studio 设置了java版本仍不能能常使用)
arduino 复制代码
// 文件位置 android/gradle.properties

org.gradle.java.home=D:\\Android\\G18
3.使用国内镜像下载 gradle
ruby 复制代码
// 文件位置 android/gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-7.5-all.zip
相关推荐
火柴就是我1 小时前
让我们实现一个更好看的内部阴影按钮
android·flutter
王晓枫1 小时前
flutter接入三方库运行报错:Error running pod install
前端·flutter
shankss9 小时前
Flutter 下拉刷新库 pull_to_refresh_plus 设计与实现分析
flutter
忆江南1 天前
iOS 深度解析
flutter·ios
明君879971 天前
Flutter 实现 AI 聊天页面 —— 记一次 Markdown 数学公式显示的踩坑之旅
前端·flutter
恋猫de小郭1 天前
移动端开发稳了?AI 目前还无法取代客户端开发,小红书的论文告诉你数据
前端·flutter·ai编程
MakeZero1 天前
Flutter那些事-交互式组件
flutter
shankss1 天前
pull_to_refresh_simple
flutter
shankss1 天前
Flutter 下拉刷新库新特性:智能预加载 (enableSmartPreload) 详解
flutter
SoaringHeart3 天前
Flutter调试组件:打印任意组件尺寸位置信息 NRenderBox
前端·flutter