skip to Main Content

With the newest Android 31 SDK (Android 12), the documentation for the SDK is missing.

The SDK Manager shows that the "Sources for Android X" exists for SDK 30 but is missing for 31:

"Sources for Android 30" exists but not for SDK 31

The documentation displays nothing:

Documentation returns nothing

Other used versions: Build Tools Version 31.0.0, Gradle 7.2, Android Gradle Plugin 7.1.0-alpha08

Is there any way to either get the documentation for SDK 31 or at least get the documentation for SDK 30 whilst still using 31?


Side note:

What usually works for loading a missing documentation is opening a Java/Android class, where you will see this popup at the top of the class:

Missing documentation on Android class (PopUp)

Normally the "Download"-option would download the documentation and fix the problem. In this case however, it returns an error:

Packages Unavailable

4

Answers


  1. Chosen as BEST ANSWER

    I found a solution that lets me use the documentation for the Android SDK 30 (whilst still using SDK 31) until they supply the actual documentation for the SDK 31:

    Go into C:Users<User>AppDataLocalAndroidSdksources (or a different directory where your SDKs are saved) and copy the contents of the folder named "android-30" (or the highest version you've got) into a newly created folder named "android-31". That's it.

    Addition: Since it seems like it's not working for everyone: I'm using the newest Canary version of Android Studio, with everything (Gradle, libraries etc.) as up to date as possible.


  2. You can attach sources from android SDK 30 as @CodingBeing mentioned, but there are extra steps to make it work.

    • Go into your SDK location (probably C:Users<User>AppDataLocalAndroidSdk) into sources folder
    • Copy android-30 directory as android-31
    • And now you should open a android-31/package.xml with your favourite text editor and carefully replace all the 30s to 31s (3 places)
    • Also, do the same to android-31/source.properties(1 place)

    And it should finally work, at least in stable Android Studio Arctic Fox 2020.3.1 Patch 2.

    Login or Signup to reply.
  3. The SDK 31 sources are available now through the Android Studio SDK manager or dl.google.com/android/repository/sources-31_r01.zip

    Login or Signup to reply.
  4. It can be built from the upcoming SDK source directly. I have automated the process using Github Workflow, here: https://github.com/ni554n/sources-for-android-sdk

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search