Android Studio Fails to Detect the Emulator After Successful Creation
Description


Solution
Open the File menu in the upper-left corner and choose Project Structure.

Under Project SDK, select Android SDK.

Click Apply and then OK in the lower-right corner to save the configuration.

Android Studio should now detect the emulator automatically.

flutter doctor Reports NO_PROXY Is Not Set
Description

Solution
Add the following key-value pair to your environment variables:
NO_PROXY=localhost,127.0.0.1,LOCALHOSTRunning the Project Hangs at “Running Gradle task 'assembleDebug'”
Here are several approaches you can try:
Switch to Mirror Repositories
In the Flutter SDK directory, open
packages/flutter_tools/gradle/flutter.gradleand adjust the repository list as follows:groovyrepositories { // google() // jcenter() 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' } }Inside your Flutter project, open
android/build.gradleand update the repository blocks:groovybuildscript { ext.kotlin_version = '1.3.50' repositories { // google() // jcenter() 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' } } } allprojects { repositories { // google() // jcenter() 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' } } }
Set Your Proxy/VPN to Global Mode and choose an overseas node (avoid Hong Kong, Taiwan, etc.).
Adjust the Gradle Wrapper Version
- In
android/gradle/wrapper/gradle-wrapper.properties, replacedistributionUrl=https\://services.gradle.org/distributions/gradle-*.*.*-all.zipwithdistributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip.
- In
Clear Caches Before Retrying
After applying the changes above, clean up the following before you rerun the project:
- Delete the
.gradledirectory underC:\Users\<username> - Delete
android/gradle/wrapper/gradle-wrapper.jarinside the project - Run
flutter cleanat the project root
- Delete the
