問題描述
我正在運行最新版本的 gradle (1.12).在項目的根目錄中,我運行以下命令,如@CommonsWare this answer 中所述,應該給出依賴關系樹:
I'm running the latest release of gradle (1.12). In the project's root directory, I run the following command, which as described in this answer by @CommonsWare should give the dependency tree:
當我運行它時,會發生這種情況:
When I run it, this happens:
$ gradle -q 依賴項
------------------------------------------------------------
Root project
------------------------------------------------------------
No configurations
有問題的項目是使用 Android Studio 內置的新項目向導從頭開始創建的 Android gradle 項目.我的頂級 build.gradle 文件如下所示:
The project in question is an Android gradle project created from scratch using the new project wizard built in with Android Studio. My top-level build.gradle file looks like this:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
}
subprojects {
repositories {
flatDir {
dirs "$rootDir/libs"
}
}
}
我的 settings.gradle 文件如下所示:
And my settings.gradle file looks like this:
include ':app', ':facebook', 'pullToRefresh'
據我了解,這是一個非常基本的 gradle 配置.有誰知道為什么依賴樹函數什么都不返回?如果我需要提供更多信息,請告訴我.
From what I understand this is a very basic gradle configuration. Does anyone have an idea why the dependency tree function is returning nothing? Let me know if I need to provide more information.
推薦答案
您的頂級 build.gradle 本身沒有任何依賴項.您必須運行(從項目根目錄):
Your top level build.gradle doesn't have any dependencies itself. You'll have to run (from the project root dir):
./gradlew app:dependencies
這篇關于無法使用 gradlew 或 gradle 查看依賴關系樹的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!