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 ?
-
1Possible duplicate of [Changing API level Android Studio](http://stackoverflow.com/questions/19465049/changing-api-level-android-studio) – Tim Biegeleisen Nov 02 '16 at 04:50
4 Answers
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

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

- 186
- 1
- 11
-
-
@Fahda.Shalhoub when you create the new project then it ask in the second step for the minimum sdk then set the minimum sdk to 16.your problem has been solved. – LoveAndroid Nov 02 '16 at 05:05
-
but I opened exist project so its open diractlly without asking me for the minimum SDK – Fahda.Shalhoub Nov 02 '16 at 05:54
-
2@Fahda.Shalhoub then go to the build.gradle(module)file and change the minSdkVersion to 16. – LoveAndroid Nov 02 '16 at 05:58
-
-
@Fahda.Shalhoub please tell me what is the problem.are you getting exception or what ?? – LoveAndroid Nov 02 '16 at 06:27
-
I changed minSdkVersion to 16 then i tried to create a new activity but its still shown the same error massage "Selected activity template has a minimum SDK level of 9" – Fahda.Shalhoub Nov 02 '16 at 06:33
-
@Fahda.Shalhoub i think you should create new project with the minsdkversion 16 and with the empty activity. – LoveAndroid Nov 02 '16 at 06:36
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.
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

- 477
- 5
- 8