Sources for Android API 23 Platform not found (Android Studio 2.0)

Android Studio does not redirect me to API sources correctly. When I hit any function, it decompiles the bytecode of the .class file instead of accessing the correct file from the sdk / sources tree. Pressing the β€œdownload” and β€œupdate” options does nothing. This is especially annoying for the implementation of listeners, since it generates function headers without green variables from the documentation (i.e. Var1, var2, etc.). I set the compression and target SDK to 23. I tried reinstalling the SDK tools, updating the AS from the channel channel, invalidating the cache, but nothing helped so far. I switched to API 21 and it works great. What am I missing?

EDIT I installed API 23 (SDK platform, tools, documents, sources), so please just leave a comment if you want to downgrade.

EDIT My build.gradle:

apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '23.0.2' defaultConfig { applicationId "com.myapp.app" minSdkVersion 10 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' compile 'com.squareup.picasso:picasso:2.5.2' compile project(':volley') compile 'com.jakewharton:butterknife:7.0.1' } 

Below you can find gradle output for an empty project (without third-party libraries) with the same set of API 23 and the same behavior.

 Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :clean :app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2330Library :app:prepareComAndroidSupportAppcompatV72330Library :app:prepareComAndroidSupportDesign2330Library :app:prepareComAndroidSupportRecyclerviewV72330Library :app:prepareComAndroidSupportSupportV42330Library :app:prepareComAndroidSupportSupportVectorDrawable2330Library :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources :app:mergeDebugResources :app:processDebugManifest :app:processDebugResources :app:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest :app:compileDebugAndroidTestRenderscript :app:generateDebugAndroidTestBuildConfig :app:mergeDebugAndroidTestShaders :app:compileDebugAndroidTestShaders :app:generateDebugAndroidTestAssets :app:mergeDebugAndroidTestAssets :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources :app:mergeDebugAndroidTestResources :app:processDebugAndroidTestResources :app:generateDebugAndroidTestSources :app:mockableAndroidJar :app:preDebugUnitTestBuild UP-TO-DATE :app:prepareDebugUnitTestDependencies BUILD SUCCESSFUL 
+87
android-studio android-api-levels
Apr 23 '16 at 18:25
source share
5 answers

For people facing the same problem, the solution is in this post for Linux and in the same section here for Windows (thanks to Aamir Abro ). Basically, you need to edit the jdk.table.xml file for an API level that is missing. I don't know why, but Android 2.0 and 2.1 RC did not populate <root type="composite" /> in <sourcePath> . I updated the source path to <root type="simple" url="file://D:/android/sdk/sources/android-23" /> and now it works.

For a Windows user, the file location is : C: \ Users {USER_NAME} .AndroidStudio2.0 \ config \ options \ jdk.table.xml

For Linux user, file location : ~ / Library / Preferences / AndroidStudioBeta / options / jdk.table.xml

Edit:

For some people, dropping the location of the SDK helped source .

+40
Apr 24 '16 at 15:51
source share

Obviously, this problem has been fixed in Android Studio 2.1. Restart the Android SDK Manager setup in Android Studio and this should fix your problem.

In Android Studio:

Windows: File β†’ Settings (ctrl + alt + s) β†’ Appearance and behavior β†’ System Settings β†’ Android SDK.

Mac: Android Studio β†’ Settings (cmd +,) β†’ Appearance and behavior β†’ System Settings β†’ Android SDK.

Click Edit to the right of the location of the Android SDK. Click Next completely through the wizard, and this should fix the problem.

This question is answered here for another question.

+182
May 17 '16 at 18:36
source share

Like qbeck mentioned in his comment, resetting the SDK path fixed the problem for some of us.

Decision:

Android Studio 2.1 reporting this: solved the problem by dropping the SDK.

Settings β†’ Appearance and behavior β†’ System Settings β†’ Android SDK.

Click "Edit" to the right of the location of the Android SDK. Next, next, next to complete the master and voila!

+7
Jun 02 '16 at 21:47
source share

To upgrade Android Studio to Api 23, go to:

Tools > Android > SDK Manager ,

then go to the SDK Tools tab or click Launch Sdandalone SDK Manager . check the Android SDK Build-tools 23.0.2 check box to install

Update:

please remove from your dependencies:

 compile project(':volley') 

and replace it with:

 compile 'com.android.volley:volley:1.0.0' 
0
Apr 23 '16 at 19:38
source share

The same problem was detected for API level 28 on Android Studio 3.2.1 on Windows 10. Update failed.

Worked after restarting Android Studio.

0
Dec 19 '18 at 15:42
source share



All Articles