Installing Android Support Repository offline

久未见 提交于 2019-12-02 15:50:44
Vipul Purohit
  1. Download the latest support repository.
    Here is the link for version v47
    To get the most recent version check out the update below
  2. Extract the downloaded zip file.

  3. Copy the folder named m2repository from the extracted folder.

  4. Navigate to extras/android directory in your SDK installation directory. For me it's:
    C:\Users\$usrname$\AppData\Local\Android\sdk\extras\android\

  5. Replace the existing m2repository folder with the one from the ZIP.
    (I suggest creating a backup first)

  6. Restart Android studio.

Hopefully you will have the newer Android support repository.

Update

To get the latest version of support repository:

a. Go to this link

b. Search for the keyword m2repository_r

c. Copy the value in <url> tag.
It should look like this:

 <complete>
    <size>355529608</size>
    <checksum>a0d22beacc106a6977321f2b07d692ce4979e96a</checksum>
    <url>android_m2repository_rXX.zip</url>
 </complete>

d. Paste it to the end of this URL: https://dl.google.com/android/repository/
Your new URL should look like this:
https://dl.google.com/android/repository/android_m2repository_rXX.zip
where XX is the version number

e. Download and continue from step 2

user6841032

You can put the downloaded zipped file in the Temp folder under the Android SDK (C:\Users\$usrname$\AppData\Local\Android\sdk\temp). Then restart the SDK manager and install it.

ABTanjir

For macOS:

  1. Download android_m2repository_r47.zip
  2. Press command + shift + g from finder and then type

    ~/Library/
    

    And press return

  3. Then go to android/sdk/extras/android
  4. Then extract and save the files under the m2repository folder.

I ran into this problem for the version of Android 2.3.1 and the android_m2repository_r47 package.

  1. Download android_m2repository_r47.zip manually.
  2. Download xml - https://dl.google.com/android/repository/addon2-1.xml
  3. Copy this 2 files to %\Android Studio\plugins\sdk-updates\offline-repo\
  4. Modify addon2-1.xml: delete all "remotePackage" tags exclude tag with android_m2repository_r47
  5. In Android Studio need add new repository. As URL need to write path to your modificated %\Android Studio\plugins\sdk-updates\offline-repo\addon2-1.xml

Try to paste the content of the folder in: Program Files\android\android studio\gradle\m2repository

I've tried and it worked well:)

If you have another computer(or friend's computer) that working android studio,

just copy the sdk folder

  • typically C:\Users\$usrname$\AppData\Local\Android\sdk
  • and need to zipping (too many folders and files in it)

oops, My first computer os is windows 10 64bit and second computer os is windows 7 32bit

and sdk trouble occurred

and I found another solution here

After 5?minutes the install seemed to go through (not sure though if it just timed out... but at least starting downloading rest of files) ... now stuck on sdk-tools-darwin-###.zip and went through after few minutes... now stuck again at emulator-darwin-4266726.zip, then build_tools_r27-macosx.zip. then on google_m2repository_gms_v11_3_rc05_wear_2_0_5.zip.... and then platform-27-r01.zip and so on... Will report back if it actually still installed everything and works. – armyofda12mnkeys Nov 3 '17 at 18:11

and I'm happy now

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!