为什么gradlew:app:dependencyInsight失败了? [英] Why did gradlew :app:dependencyInsight fail?

查看:723
本文介绍了为什么gradlew:app:dependencyInsight失败了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行此命令以列出firebase-messaging库的所有依赖项:

I try to run this command to list all the dependencies of firebase-messaging library :

gradlew :app:dependencyInsight --configuration compile --dependency firebase-messaging

但是我回来了:

:app:dependencyInsight找不到与给定输入匹配的依赖项 在配置':app:compile'

:app:dependencyInsight No dependencies matching given input were found in configuration ':app:compile'

0秒内成功完成1项可执行任务:1项已执行

BUILD SUCCESSFUL in 0s 1 actionable task: 1 executed

这是我的build.gradle文件:

this is my build.gradle file :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.test.myapplication"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:27.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.google.firebase:firebase-messaging:12.0.1'
}

我做错了什么?

推荐答案

这是因为在implementation配置中声明了firebase-messaging. compileClasspath 应使用

That's because firebase-messaging is declared in the implementation configuration. compileClasspath should be used

尝试:

gradlew :app:dependencyInsight --configuration compileClasspath --dependency firebase-messaging

edit:如此处

使用gradle :app:dependencies来获取所有依赖项似乎是获取firebase-messaging

Using gradle :app:dependencies to fetch all dependencies seems to be the cleaner way to get all the dependencies of firebase-messaging

这篇关于为什么gradlew:app:dependencyInsight失败了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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