I have this grade file:
//ext.support_library_version = '24.0.0'
android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
applicationId "---"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
...
}
But then when i try to open any android related class, it says i haven't got sources for api24, even tho the buildToolsVersion '24.0.0'
is installed. Any idea why?
Sources for Android N are not yet published and not available for installation in the SDK manager. When the source package becomes available, you need to install it separately, as with any previous SDK version.
Update 2016-08-24: The Android API 24 sources are now available in the SDK manager.
After downloading you might need this trick to refresh the SDK installation.
I had the same problem with API 25 and Android Studio 2.2
Try the following:
Close Android Studio.
Open ~/Library/Preferences/AndroidStudio2.2/options/jdk.table.xml
or C:\Users{USER_NAME}.AndroidStudio2.2\config\options\jdk.table.xml
Note the Android Studio version in the pach.
Locate <sourcePath>
for Android API 24 Platform and for previous one. You can look that <sourcePath>
for problem API hasn't second <root>
element with url.
Investigate path of sources, check that sources was really installed.
Copy <root>
from another <sourcePath>
and set correct url. It will be similar to
<sourcePath>
<root type="composite">
<root type="simple" url="file://$USER_HOME$/Library/Android/sdk/sources/android-24" />
</root>
</sourcePath>
Save the file and start Android Studio
https://stackoverflow.com/a/36825435/1263771
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