简体   繁体   中英

TargetSdkVersion in library grater then targetSdkVersion in application

I have an Android application with targetSdkVersion = 26 and compileSdkVersion = 26. Is it possible to work fine when I use a library (use gradle dependencies) with target targetSdkVersion = 28 and compileSdkVersion = 28 ? Or it is requre to update target and compile versions in application like in library? Is target and compile versions should be the same? Is target and compile version should be 28 to migrate to AndroidX? Is AndroidX can be use with version 26?

Target SDK version: The targetSdkVersion value tells Android which API level your app was designed to run on. Keep this to the latest version.

Compile SDK: version, or build target, specifies which version to use when building your own code. When Android Studio is looking to find the classes and methods you refer to in your imports, the build target determines which SDK version it checks against.

You should update the target and compile sdk to 28 in order to use the new library

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM