1. Android Studio Issues
#1) Missing Dependency Library Issue
One of the most common issues when getting started with Android is related to missing dependency libraries, as shown in Figure . At this point, clicking the hyperlink will automatically redirect you to the installation page.
After installation, simply rerun the application, as shown in Figure :
#2) Unable to Connect to Android Repository
This is also one of the most common issues. If you find yourself unable to download certain dependencies, please consider this situation first. Navigate to File > Settings > Appearance & Behavior > System Settings > Android SDK > SDK Update Sites. You may see that the Android Repository is currently unreachable, as shown in Figure :
Download Dependency Failure
This issue arises because it requires downloading the Android SDK from Google, which is currently inaccessible in China. Therefore, you can configure a proxy or use a VPN.
#3) Android Package Configuration Issue
The usual error messages are:
Could not HEAD **Could not GET **
For example: Android Studio Could not GET gradle-3.2.0.pom
.
These issues are caused by the inability to connect to the Maven repository. The solution is as follows:
Navigate to the project directory:
your_project_name/android
.Open
build.gradle
.Find the following section and add
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
:
allprojects { repositories { google() jcenter() maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } // Add this line } }
Go to File > Settings > Build, Execution, Deployment > Build Tools > Gradle in Android Studio, check Enable embedded Maven repository, and restart Android Studio to resolve the issue.
Note: There is a situation where, even after setting according to the steps above, the problem may still persist with an error message similar to Could not HEAD maven.aliyun.com
. In this case, please check C:\Users\{user_name}\.gradle\gradle.properties
for proxy settings. Deleting these settings will resolve the issue.
#4) Hot Reload Not Working Issue
After setting a proxy in terminal emulators like Terminal, the "Hot Reload" feature may become ineffective. At this point, calling Save (cmd-s / ctrl-s) will not trigger a hot reload, and the hot reload button (the one with the lightning ⚡️ icon) will also not display. Removing the proxy will resolve this issue.
Additionally, there are some cases where hot reload will not take effect, such as when the main
function is modified or global static methods are changed. Readers can understand that "Hot Reload" only rebuilds the entire widget tree; if the changes are not within the widget tree construction process, "Hot Reload" will not work. In such cases, simply restart the app.