This article uses Android Studio to create a Flutter project and run it successfully.
The running process may involve network environment configuration issues.
Friends who think it is too simple can just ignore it.
development environment
win10
androidstudio2022.1.1
jdk11
fluttersdk-flutter_windows_3.7.8
practice
Follow the following process: first click to create a project,
select flutter sdk
and fill in the project information
. Click create, wait for android studio to run, and wait for loading to complete.
run
Click the green triangle icon in the upper right corner of Android Studio to run.
There are two situations here. If your network is good, you can start running after a while. If your network is not good, you need to perform some additional network environment configuration.
Network environment configuration
(1) Enter the packages\flutter_tools\gradle folder and open the flutter.gradle file. The directory is as shown below:
Open the arrow file, find the buildscript location, and modify it as follows:
Modification point 1
Modification point 2
Modification point 3
androidstudio build.gradle deployment
Related instructions:
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
private static final String DEFAULT_MAVEN_HOST = "https://storage.flutter-io.cn"
(2) Enter the flutter\packages\flutter_tools\gradle folder, and then open the resolve_dependencies.gradle file. The directory is as follows:
Find the repositories and modify the dependencies as follows:
Then save. Clear the cache and restart Android Studio, and try clicking the install button again to check the installation status.
that’s all-------------------------------------------------------------