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

前端 未结 8 1682
再見小時候
再見小時候 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 21:07

    I use these two links.

    This link gives me the latest buildTools Version
    https://developer.android.com/studio/releases/build-tools.html



    This link gives me the latest supportLibraryVersion https://developer.android.com/topic/libraries/support-library/revisions.html

    0 讨论(0)
  • There may be other ways, but here is what i use:

    You can find out the latest version using Android Studio by replacing the version number of your library in build.gradle compile line, with just + , and click on Sync Now in upper right corner of the window.

    in your case, for example

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

    Android Studio will pop up a hint/bulb, which has options Replace with specific version you can click, which will fill-in the latest version in-place of +. Please see below screeshot:

    android studio hint

    If this doesn't work the first time, let gradle complete its sync, and retry (replace + with + or any file modification will do, click the sync now again and hint bulb will show up).

    For example, for your library, i simply pasted this line compile 'com.android.support:mediarouter-v7:+' under my dependencies and followed the above process, Android Studio filled in with below version

    .

    0 讨论(0)
提交回复
热议问题