简体   繁体   中英

Selected activity template has a minimum SDK level of 9

I can't create a new window on Android Studio. Error message shown in red "Selected activity template has a minimum SDK level of 9" how can I solve this issue?

在此处输入图像描述

Chose an higher minimum API level (at least 14 for this template). Go back to the first step and change the minimum api level.

Selected Activity template has a minimum SDK level of X

Android Studio says so, because you've selected Minimum SDK version to be less than X. in you case SDK version less than 9 in the previous option.

See this:

在此处输入图片说明

I'd get the same error as yours, as I've set Minimum SDK to be : Android 1.1 .

FIX:-

Choose an SDK version higher than 9.

In your case, it's ideal to choose API 16: Android 4.1(Jelly Bean) and above as more features would be supported from this version onwards.

You have to open build.gradle and change the minSdkVersion to 16. Then, you have to rebulid the project. I fix that issue by this way

Go to app level gradle file. You can find it from the gradle scripts -> build.gradle(Module:app). In android{defaultConfig{minSdkVersion}}} put 16 and Sync project from top right. This should solve your problem. This happens because the API Level expressed by an application will be compared to the API Level of a given Android system, which may vary among different Android devices. You can find more details here https://developer.android.com/guide/topics/manifest/uses-sdk-element

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