如何将Android SDK源附加到Android Studio?
当我打开其中一个Android类时,不会出现带有"附加源"选项的"未找到源"窗口.
另外一种方法是什么?
Android Studio无法正确地将我重定向到API源.当我点击任何函数时,它会反编译.class文件字节码,而不是从sdk/sources树访问正确的文件.
点击"下载"和"刷新"选项什么都不做.这对于实现监听器来说尤其令人讨厌,因为它从文档中生成函数"不带变量"的标题(即var1,var2等).我已将complie和目标SDK设置为23.我尝试重新安装SDK工具,从canary通道更新AS,使缓存无效但到目前为止没有任何帮助.我切换到API 21,它工作正常.我错过了什么?
编辑 我已经安装了API 23(SDK平台,工具,文档,资源),所以如果你想进行downvote,请发表评论.
编辑 我的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'
}
Run Code Online (Sandbox Code Playgroud)
您可以在下面找到具有相同API 23设置和相同行为的空白项目(没有第三方库)的gradle输出.
Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Configuration on demand is an incubating feature.
Incremental …Run Code Online (Sandbox Code Playgroud)