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
相关推荐
2601_949847751 天前
Form-data 跨端三方库仓颉适配全流程
前端·javascript·flutter
大龄秃头程序员1 天前
Flutter 中我为什么把 GetX 定位为高效率方案,而不是默认架构方案
flutter
传奇开心果编程1 天前
组合优先开发范式:从汉字造字原理到声明式UI组件组合思想
android·flutter·ios·swiftui·移动开发·harmonyos·android jetpack
2501_944521592 天前
Ramda 跨端三方库仓颉适配全流程
开发语言·javascript·flutter·php
大龄秃头程序员2 天前
Flutter 架构里总被混淆的 IoC、DI、Service Locator,到底是什么关系?
flutter
事圆则缓2 天前
Flutter 与原生交互的最后一层:RTC 视频帧怎么走
flutter·音视频·实时音视频
2601_949847752 天前
jose 跨端三方库仓颉适配全流程
前端·javascript·flutter
2601_949970692 天前
msgpackr 跨端三方库仓颉适配全流程
前端·javascript·flutter
2601_949970693 天前
HumanizeDuration 跨端三方库仓颉适配全流程
前端·javascript·flutter
传奇开心果编程3 天前
【Flutter踩坑排雷】第3课:const 误用坑|const 错误使用引发 UI 异常与性能损耗
flutter·移动开发·跨平台·dart·编程语言理论·编程框架·声明式ui