1

I wish to add the following to my Android App via Gradle:

dependencies {
    ...
    compile "com.android.support:support-dynamic-animation:25.3.0"
}

but devices with Sdk version less then Sdk Version=16 do not support this library. Is there a way that I can compile only for the devices with Sdk version higher then or equal to 16 and not for the rest?

Flying Monkey
  • 669
  • 1
  • 5
  • 13
  • 2
    Unless you are planning on distributing two separate APKs (one for older devices, another for newer devices), what you want does not make much sense. Usually, the issue is not with compiling in a library, but using the library. Use `Build.VERSION.SDK_INT` to identify the API level at runtime and avoid using the library on those older devices. – CommonsWare May 10 '17 at 15:37

0 Answers0