Original: Modify Android Studio's default API level (SDK version)
Android Studio (2.1.2) will only allow you to select the minimum supported SDK version, and the default target compilation SDK version will be the API level targeted by the latest SDK platform in the current SDK of the system. But many times we don't need the latest SDK version, how do we change it?
Modify the related lines in the Gradle scripts->build.gradle (Module:app) in the project catalog as follows:
Of course, you can also do the graphical operation, right-click the project directory Select "Open Module Settings", and then modify the compile SDK Version:
This way Android Studio will help you to automatically modify the Build.gradle.
The higher API level goes to the lower API levels, and sometimes compatibility issues arise . For example, the lower version of the API level does not support appcompatactivity (in android.support.v7), so the relevant modifications are required. For example, I encountered the following error:
Mainly in the styles.xml to find the relevant theme,
Change the theme to one that is supported by the appropriate version, for example,
Modify Android Studio's default API level (SDK version)