Mac+Android Studio配置 Flutter环境
1、环境变量
.zshrc
#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
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
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
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' }
原文地址:https://blog.csdn.net/weixin_41733225/article/details/135862264
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!