build.gradle dependencies auto updates itself

前端 未结 3 1595
后悔当初
后悔当初 2021-01-19 04:42
compile \'com.google.android.gms:play-services:8.3.0\'
compile \'com.android.support:support-v4:22.2.1\'
compile \'com.android.support:design:22.2.1\'
3条回答
  •  我在风中等你
    2021-01-19 04:58

    Android Studio doesn't update the dependencies if you specify the version

    Example:

    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.android.support:support-v4:22.2.1'
    compile 'com.android.support:design:22.2.1'
    

    In this case AS will tell you when there is a newer version without updating them.

    If you the + in your dependencies gradle updates with the latest version according to the build.gradle.
    For example:

    compile 'com.android.support:support-v4:22.2.+'
    compile 'com.android.support:support-v4:22.+'
    compile 'com.android.support:support-v4:+'
    

    It is a good practice to avoid it.

提交回复
热议问题