Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why did gradlew :app:dependencyInsight fail?

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

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

but it's return me :

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

BUILD SUCCESSFUL in 0s 1 actionable task: 1 executed

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

What i did wrong ?

like image 374
zeus Avatar asked Apr 04 '18 08:04

zeus


People also ask

Is Gradle compile deprecated?

Gradle adds the dependency to the build output only, for use during runtime. That is, it is not added to the compile classpath. This configuration is deprecated (it's available in AGP 1.0-4.2).

What does -> mean in Gradle dependencies?

It means that dependency graph contains multiple dependencies with the same group and module but different versions for e.g. org.


1 Answers

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

Try :

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

edit : using compileClasspath won't work with Android as described here

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

like image 50
ToYonos Avatar answered Sep 28 '22 09:09

ToYonos