[Android Studio] Configure the domestic mirror source (using hosts)

I wrote before that the IP address port of the domestic mirror is directly used to configure the domestic mirror. The link is as follows:
Android studio configures the domestic mirror source,
but this method may not work for every configuration on every computer, so it is given The second method: add a domestic mirror image to the system file hosts (although...maybe...not necessarily...it will work^- ^, it is possible for the blogger to test it personally)

Method steps:

One, configure hosts

  1. Find the hosts file and open the file with notepad or notepad++:
    Insert picture description here

  2. Add the following mapping at the end:
    Insert picture description here
    302.208.41.33 is obtained by pinging the domain name dl.google.com through http://ping.chinaz.com/ the detection website. I can still use this at present, if Later, if it fails, you can go to the website and ping dl.google.com to find another one.

    Insert picture description here

Two, configure Android Studio

  1. Open the root directory of Android studio (you can right-click the shortcut icon of AS to find its root directory), enter the bin folder, and open studio.exe.vmoptions or studio64.exe.vmoptions with notepad or notepad++

    If the system is 32-bit, modify studio.exe.vmoptions, if it is 64-bit, modify studio64.exe.vmoptions; if you don’t know your system, modify both.
    Insert picture description here
    Add the following data:

    -Djava.net.preferIPv4Stack=true  
    -Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml  
    -Didea.patches.url=http://dl.google.com/android/studio/patches/
    

    As shown below:
    Insert picture description here

  2. The configuration in Android studio's Setting is as follows:
    Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_40849588/article/details/90575618