Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio quick documentation always "fetching documentation"

I just moved to Android Studio from Eclipse, and I found that it always shows "fetching documentation" when I use quick documentation (Ctrl+Q).

How can I solve this problem? I downloaded the documentation for API 19, and the problem persists.

enter image description here

like image 646
Bruce Avatar asked Apr 30 '14 02:04

Bruce


2 Answers

The problem is Android Studio does not automatically update the source link of reference even when the documentation is already downloaded.

The default link in jdk.table.xml is http://developer.android.com/reference/ (android studio tries to connect to this online server even if the network is blocked).

To solve the problem, we can just redirect the reference to local source.

MacOS

On MacOS, the config file jdk.table.xml is under ~/Library/Preferences/AndroidStudio<version>/options/, and the docs are here: ~/Library/Android/sdk/docs/, or the custom path of your Android SDK.

In jdk.table.xml, find all the lines:

<root type="simple" url="http://developer.android.com/reference/"> 

and modify them to

<root type="simple" url="file://$USER_HOME$/Library/Android/sdk/docs/reference/"> 

Windows

On Windows, the file jdk.table.xml is under C:\Users\Name\.AndroidStudio<version>\config\options

In AndroidStudio 3.3, modify to

<root type="simple" url="file://$USER_HOME$/AppData/Local/Android/sdk/docs/reference"  /> 

Android Studio (any os)

Then, in File -> Invalidate Caches / Restart… select Invalidate, and retry using Quick Documentation. It should display instantly. If it doesn't, select Invalidate and Restart, and you should be good to go.

like image 82
Htea Avatar answered Sep 28 '22 03:09

Htea


Go to: Tools > Android > SDK Manager. Select SDK Tools tab and:

  1. if Documentation for Android SDK is unchecked, check it and click apply
  2. If Documentation for Android SDK is checked, uncheck it and click apply. After uninstall completes check it again and click apply.
like image 24
Darush Avatar answered Sep 28 '22 02:09

Darush