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:
The documentation displays 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:
Normally the "Download"-option would download the documentation and fix the problem. In this case however, it returns an error:
4
Answers
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.
You can attach sources from android SDK 30 as @CodingBeing mentioned, but there are extra steps to make it work.
C:Users<User>AppDataLocalAndroidSdk
) intosources
folderandroid-30
directory asandroid-31
android-31/package.xml
with your favourite text editor and carefully replace all the30
s to31
s (3 places)android-31/source.properties
(1 place)And it should finally work, at least in stable Android Studio Arctic Fox 2020.3.1 Patch 2.
The SDK 31 sources are available now through the Android Studio SDK manager or dl.google.com/android/repository/sources-31_r01.zip
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