How to check what is the latest version of a dependency to use in gradle

前端 未结 8 1680
再見小時候
再見小時候 2020-12-29 20:24

I\'ve always added dependencies like this:

dependencies {
    compile \'com.android.support:mediarouter-v7:19.+\'
}

but in the recent versi

8条回答
  •  囚心锁ツ
    2020-12-29 20:49

    the answer of ashoke is correct if you want the latest version.

    But if you just want to replace "+" by the version you are currently using (therefor protection yourself against bug in future update)

    eg:

     compile 'com.android.support:appcompat-v7:21.0.+'
    

    to

     compile 'com.android.support:appcompat-v7:21.0.3'
    

    (but not using 23.0.1)

    this is the easiest way, no software needed:

    run

    $ ./gradlew clean tasks --debug > ~/whatever.txt
    

    then look for "com.android.support:appcompat-v7:21.0."

    a few line below you will see

    "Using com.android.support:appcompat-v7:21.0.3 from Maven repository"

提交回复
热议问题