Dynamic versions (using +) of dependencies in gradle

I am using compile 'com.localytics.android:library:3.8+' in my project.
I want to know that is the latest version of this dependency is picked when the release apk is created or every time when the user opens the app (downloaded from playstore).


new version downloads when You create a new build. There is nothing changes in it before You create a new one.


+ here known as dynamic dependencies.

Simply + will use the latest or updated dependency but Using dynamic dependencies (for example, com.localytics.android:library:3.8+ ) can cause unexpected version updates and regression incompatibilities as suggested by google docs

Pros

  • Stay updated
  • Manually updating dependencies can be tedious
  • Cons

  • Can break your current code flow due to changes in lib code

  • Usually there can be some bug found in the new releases so be ready to face unexpected behavior or crash

  • Conclusion : As advised by google always specify the library version check under Adding Support Libraries


    You should avoid the use of the + in your dependencies.

    In this way you will not be able to replicate your build in the future because you can't know the versions used in your app.

    Dynamic versions add nondeterminism to your build and can introduce unexpected behavior changes to your app.

    To check Newer Library Versions Available you can use a lint check:

  • Go to Settings > Editor > Inspections > "Newer Library Versions Available"

  • Enable the Newer Library Versions Available inspection

  • Go to Analyze > "Run Inspection By Name" and search for Newer Library Versions Available 在这里输入图像描述

  • You will launch a link check

  • 在这里输入图像描述

    链接地址: http://www.djcxy.com/p/36316.html

    上一篇: 我如何在nomachine远程桌面上运行xmonad?

    下一篇: 动态版本(使用+)Gradle中的依赖关系