Modify Android Studio's default API level (SDK version)

Source: Internet
Author: User
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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.