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:
Quick fix: Go to the Tools –> SDK manager –> SDK tools. Deselect Hide obsolete packages option on the right bottom and further install Android SDK Tools(obsolete). A new folder named Tools is now generated in the SDK directory.
Close the current project and you'll see a pop-up with a dialog which will then proceed to Configure option. Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local. properties and select Valid Target.
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>\AppData\Local\Android\Sdk\sources (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.
The SDK 31 sources are available now through the Android Studio SDK manager or dl.google.com/android/repository/sources-31_r01.zip
You can attach sources from android SDK 30 as @CodingBeing mentioned, but there are extra steps to make it work.
C:\Users\<User>\AppData\Local\Android\Sdk
) into sources
folderandroid-30
directory as android-31
android-31/package.xml
with your favourite text editor and carefully replace all the 30
s to 31
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With