How to Compile Android API 19 App?

Asked

Viewed 94 times

0

I have an app here that’s a little old and I need to build it with API 19. But when I tried to climb Google Play, I was warned that my app should be at least API 26 (Android 8.0).

But I need to compile with API 19 because of the libraries the application uses.

I was reading about the compileSdkVersion, but I have little experience in this area of build apps.

How can I proceed?

1 answer

2


The Play Store error probably indicated that your application should support API 26, which means that your compileSdkVersion and targetSdkVersion must have a value of 26 or more. In practice, the first attribute indicates which features it can use, so that you get build errors when trying, for example, to use an unsupported method; and the second is an indication that the application supports the informed version. This reply (in English) has more information.

Having this clarified, my suggestion is to update Android Studio to a version higher than 3.0; and update the compileSdkVersion and targetSdkVersion from the app to the latest possible versions (>=26) and sync Gradle. During the change of versions you will probably have to update other dependencies, such as Gradle Build Tools and other libraries. A tip is to keep the dependencies of Android Support in its version 27, because in the next version are introduced changes related to Androidx that you probably do not want to use (it is necessary to convert the application as all visual support components are moved to other packages).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.