Installing Android Support Repository offline

痞子三分冷 提交于 2019-12-03 02:20:23

问题


I am trying to setup Android Studio + Android SDK on Linux. I was able to setup Android Studio and SDK Tools and other components except "Android Support Repository" (The download kept failing) so I downloaded android_m2repository_r30.zip and tried to place its contents(which is a directory m2repository) in the SDK directory tree but it is not recognized.

I have tried placing in several paths including

pathtosdk/extras/android/m2repository , pathtosdk/extras/android/support/m2repository

and

pathtosdk/extras/support/m2repository

But none of them works. Where should I place the contents of the zip file to have it installed.


回答1:


  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




回答2:


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.




回答3:


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.



回答4:


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



回答5:


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

I've tried and it worked well:)




回答6:


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



来源:https://stackoverflow.com/questions/36936271/installing-android-support-repository-offline

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