R Singh
R Singh

Reputation: 765

Installing Android Support Repository offline

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.

Upvotes: 29

Views: 71339

Answers (6)

Vipul Purohit
Vipul Purohit

Reputation: 9827

  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

Upvotes: 57

ABTanjir
ABTanjir

Reputation: 126

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.

Upvotes: 2

yane
yane

Reputation: 311

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

Upvotes: 0

Paya
Paya

Reputation: 11

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

I've tried and it worked well:)

Upvotes: 0

user7963071
user7963071

Reputation: 31

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

Upvotes: 0

user6841032
user6841032

Reputation: 61

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.

Upvotes: 6

Related Questions