Luk*_*uke 95 android-studio android-api-levels
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 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
Run Code Online (Sandbox Code Playgroud)
Mig*_*gne 196
显然,此问题已在Android Studio 2.1中得到修复.在Android Studio中重新运行Android SDK Manager设置,这应该可以解决您的问题.
在Android Studio中:
Windows:文件 - >设置(ctrl + alt + s) - >外观和行为 - >系统设置 - > Android SDK.
Mac:Android Studio - >首选项(cmd +,) - >外观和行为 - >系统设置 - > Android SDK.
单击Android SDK位置右侧的" 编辑 ".在向导中一直单击" 下一步 ",这样可以解决问题.
这是回答了在这里的一个不同的问题.
Luk*_*uke 45
对于面临同样的问题的人,解决的办法是在这篇文章为Linux,并在同一主题在这里为Windows(感谢 阿米尔ABRO).基本上,您必须编辑缺少 API级别的jdk.table.xml文件.我不知道为什么,但Android的2.0和2.1 RC不填写<root type="composite" />在<sourcePath>.我更新了源的路径<root type="simple" url="file://D:/android/sdk/sources/android-23" />,现在它可以工作了.
对于Windows用户文件位置:C:\ Users {USER_NAME} .AndroidStudio2.0\config\options\jdk.table.xml
对于Linux用户文件位置:〜/ Library/Preferences/AndroidStudioBeta/options/jdk.table.xml
编辑:
对于某些人重置SDK位置有帮助的来源.
| 归档时间: |
|
| 查看次数: |
43250 次 |
| 最近记录: |