如何让Android工作室下载的依赖源和javadoc? [英] How to make Android Studio download dependencies sources and javadoc?

查看:184
本文介绍了如何让Android工作室下载的依赖源和javadoc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查这个帖子: <一href="http://stackoverflow.com/questions/12718753/how-to-download-dependency-sources-for-gradle-project-in-idea">How下载相关来源摇篮项目的想法?

I have already checked this post: How to download dependency sources for Gradle project in IDEA?

但是,这并不为我工作。也许是因为他们所指的IntelliJ IDEA,和我遇到的问题与Android工作室。

But it didn't work for me. Maybe it is because they are referring to IntelliJ Idea, and I am having the issue with Android Studio.

我已经尝试添加

apply plugin: 'idea'
idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}

这两个根的build.gradle文件(我是在一个多设置)或应用程序的build.gradle文件。

Both to root's build.gradle file (I am in a multiproject setup) or to the application's build.gradle file.

我的应用程序的摇篮文件:

My application's gradle file:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.4.2'
    }
}

repositories {
    mavenCentral()
}
dependencies {
    compile files('libs/android-support-v4.jar')
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.8.4'
}
android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }
}

那么,在Android的工作室,当我点击从universalimageloader库的任何方法,我得到一个屏幕说,没有任何附加的来源。如果我点击连接源它表明:

Then, in Android Studio when I click on any method from the universalimageloader library, I get to a screen saying that there are no sources attached. If I click attach sources it shows:

正如你所看到的,只有lib中的jar下载到摇篮缓存。否* -sources.jar或*被下载-javadoc.jar。我已清理的项目,除去.gradle文件夹,迫使它从行家重新下载。没有运气。

As you can see, only the lib's jar was downloaded to gradle cache. No *-sources.jar or *-javadoc.jar were downloaded. I have cleaned project, removed .gradle folder to force it to download again from maven. No luck.

我仔细检查了装载通用图像有来源和javadoc在行家可用,所以这不是问题。

I double checked that universal image loaded has sources and javadoc available in maven, so that is not the problem.

谢谢!

推荐答案

目前Android的工作室进口图书馆与资源。至于Java文档preSS F1。

Currently Android Studio imports libraries with sources. As for java docs press F1.

旧的回答:

当我们在谈论早期preVIEW,简单的解决办法获胜。

As we are talking about early preview, simplest fix wins.

有关,现在只需手动添加到项目结构对话框中的项目。事情甚至更糟,因为现在的Andr​​oid Studio会从哪个不相关的原生Android摇篮配置和任务,如所有的依赖剥夺模块文件(IML)模块有robolectric依赖和额外的任务和配置localTest在build.gradle增加。在打开的Andr​​oid工作室它会删除相关性,则需要重新添加。

For now is just manually add them to the project in Project Structure dialog. Things are even worse as now Android Studio will strip module files (iml) from all dependencies which are not related to native Android Gradle configurations and tasks e.g. module has robolectric dependency and extra task and config localTest is added in build.gradle. After you open Android Studio it will remove dependency, you need to add it again.

有关目前我保持我的git的IML文件和文件夹.idea。发射后

For time being I am keeping iml files and .idea folder in my git. After launch

git checkout myproject/myproject.iml

这篇关于如何让Android工作室下载的依赖源和javadoc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆