Mac+Android Studio配置 Flutter环境

Fluttrer中文下载官网

Flutter下载官网

1、环境变量

.zshrc

bash 复制代码
#Flutter
export PUB_HOSTED_URL="https://pub.flutter-io.cn"
export FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn"
export FLUTTER_HOME=/Users/leon/Flutter/flutter_3_10_4/flutter
export PATH=$FLUTTER_HOME/bin

2、Android项目

(1)android/build.gradle

android/build.gradle

groovy 复制代码
		maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }

(2)Gradle

android/gradle/wrapper/gradle-wrapper.properties

(3)AGP

android/build.gradle

(4)设置 Flutter 和 Dart

  • Flutter Sdk
  • Dart Sdk

3、配置 Flutter Sdk

(1)flutter\packages\flutter_tools\gradle\flutter.gradle

groovy 复制代码
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }

(2)flutter\packages\flutter_tools\gradle\resolve_dependencies.gradle

groovy 复制代码
      maven { url 'https://maven.aliyun.com/repository/google' }
      maven { url 'https://maven.aliyun.com/repository/jcenter' }
      maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
      maven { url 'https://storage.flutter-io.cn/download.flutter.io' }
相关推荐
iBaoxing6 小时前
mac 使用 launchctl 实现每次登录系统时 frpc 就会自动启动
macos
鹏阿鹏7 小时前
【Mac】终端改色-让用户名和主机名有颜色
macos
叶羽西10 小时前
Android Studio打开一个外部的Android app程序
android·ide·android studio
jcLee9511 小时前
Flutter/Dart:使用日志模块Logger Easier
flutter·log4j·dart·logger
易我数据恢复大师11 小时前
怎么设置电脑密码?Windows和Mac设置密码的方法
windows·macos·电脑
tmacfrank11 小时前
Flutter 异步编程简述
flutter
tmacfrank12 小时前
Flutter 基础知识总结
flutter
叫我菜菜就好12 小时前
【Flutter_Web】Flutter编译Web第三篇(网络请求篇):dio如何改造方法,变成web之后数据如何处理
前端·网络·flutter
AiFlutter16 小时前
Flutter-底部分享弹窗(showModalBottomSheet)
java·前端·flutter
几维安全18 小时前
如何保护你的 iOS 应用免受逆向工程攻击
macos·objective-c·cocoa