Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
289 views
in Technique[技术] by (71.8m points)

android - Unable to see dependency tree with gradlew OR gradle

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 dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

No configurations

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"
        }
    }
}

And my settings.gradle file looks like this:

include ':app', ':facebook', 'pullToRefresh'

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your top level build.gradle doesn't have any dependencies itself. You'll have to run (from the project root dir):

./gradlew app:dependencies

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...