0

I have created an app in android, sdk version 22. I wanted to use a library for my project which is compiled in version 23. Is it possible?

Or in other words, is it at all possible by some means to import a library compiled in higher version to an android project compiled in lower?

vish4071
  • 5,135
  • 4
  • 35
  • 65

3 Answers3

0

The following answer might help you from another SO answer:

It is probably doable by branch checking SDK version in code level like if android.os.Build.VERSION.SDK_INT < 11 then do not run this, but not recommended by dev guide:

Platform version must be lower than or equal to the Android project

A library is compiled as part of the dependent application project, so the API used in the library project must be compatible with the version of the Android library used to compile the application project. In general, the library project should use an API level that is the same as — or lower than — that used by the application. If the library project uses an API level that is higher than that of the application, the application project will not compile. It is perfectly acceptable to have a library that uses the Android 1.5 API (API level 3) and that is used in an Android 1.6 (API level 4) or Android 2.1 (API level 7) project, for instance.

Community
  • 1
  • 1
Nike15
  • 544
  • 3
  • 16
0

You can go into the build.gradle of the library then change the compile SDK tools back to 22 since API 22 and 23 are not too different. You can work with this one in the mean time until you find a permanent answer If you are going to be adding the library using compile dependency that get it from the web i haven`t figured that out as yet but if you have tough times there download the master zip of the libabry then follow this link on howto import a library offline.

This must do you the magic in using your desired library

Community
  • 1
  • 1
Flash
  • 1,105
  • 14
  • 16
0

android offers many support options in the android.support.v packages. This Link is a quick reference of changes from version 22 to 23.

Pomagranite
  • 696
  • 5
  • 11