无法使用 gradlew 或 gradle 查看依赖关系树

2023-02-01移动开发问题
106

本文介绍了无法使用 gradlew 或 gradle 查看依赖关系树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在运行最新版本的 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 查看依赖关系树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何在 COCOS2d Android 中使用 CClistview?
How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)...
2024-08-12 移动开发问题
5

cocos2d-android:如何显示分数
cocos2d-android: how to display score(cocos2d-android:如何显示分数)...
2024-08-11 移动开发问题
7

Sqlite 数据库未从资产文件夹 Android 复制
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)...
2024-04-15 移动开发问题
8

SQLite 数据库副本在由设备而不是模拟器生成时出现损坏
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)...
2024-04-15 移动开发问题
4

安卓文件拷贝
Android file copy(安卓文件拷贝)...
2024-04-15 移动开发问题
6

Android如何在android中检测Edittext的Copy事件
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)...
2024-04-15 移动开发问题
5