Selected activity template has a minimum SDK level of 9 - android

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 ?

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

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.

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

Related

(Unity) Your app currently targets API level 30 and must target at least API level 31

Today I got following warning from Google Play "Your app currently targets API level 30 and must target at least API level 31 to ensure it is built on the latest APIs optimized for security and performance."
How can and where I should specify target API level? To be honest I didn't specify anything. I just recently moved from Unity 2018 to Unity 2020 and got following warning.
How can it be fixed? Thank you in advance
First of all, always ensure you are using the latest stable build of unity. Older versions may not have the new API levels required for the latest android versions.
Then go to:
Edit -> Project Settings -> Player -> Other Settings
If you have selected Android as the Build Platform:
Under the Identification, there will be a Minimum API Level and Target API Level.
Set the Target API Level to automatic, which will be the highest installed. If you won't have an API Level such as 31, it means you need to upgrade your unity version or install the API level manually.
if you have android studio or unchecked the ticks that Unity handles the android SDKs automatically you need to check these two folder
C:\Users\username\AppData\Local\Android\Sdk\build-tools
C:\Users\username\AppData\Local\Android\Sdk\platforms
unity has issue with sdk API 31+ (32 and so on...)
unity will download build-tools based on target sdk on player settings, if you set to automatic, it will download highest version (33 right now), which is problematic,
set target sdk to 31
or set the Target API Level to automatic, unity will search build-tools folder automatically for highest version which you need to remove any 31+ if unity has downloaded before.
if you have android studio targeting 33 for android build u must cut it to desktop and put it back for ur android build.

Android Error: This template requires a build target API version of at least 14, and the current version is 7

I installed the SDK and I like work with API 7 but when I want to create a new Activity Main I have this problem and I can't create a new Activity, thanks.
This template requires a build target API version of at least 14, and the current version is 7
In the log, I can read this:
Not targeting the latest versions of Android; compatibility modes apply. Consider testing
and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.
I recently faced the same problem when creating the activity or while setting the new android application project and able to solve this problem in this manner.
I checked the system image folder which is in sdk/system-images,build tools folder-sdk/build-tools and found that these folder does not have the API's that i am using at Minimum required sdk,target sdk,compile with. In each of these you need to provide the API no. or Android version.
So check that the API's that you are using for(Minimum required sdk,target sdk,compile with) are installed and also check the system-images and build-tools folder should have these API's
if you have done this your problem must be solved.
You probably set Build SDK to API 7. Normally, you should set Build SDK to the highest possible API level and set the other SDK, it's called Run SDK or don't rememeber how to the minimum API version you want your application to run on.
I ran into this same issue even though I had set in my AndroidManifest.xml minSdkVerion to 13 and targetSdkVersion to 19. What fixed it for me was in Eclipse going to Project > Properties > Android then checking the highest API level in Project Build Target box (API 19 for me).

The building target and min sdk version

I am trying to make an android app. I am struggle at finding the suitable API level for my first app. I also not sure what min ark version is and what should I type in while creating a new project.
Can someone please answer me how to determine the correct API level and also what exactly is min sdk version??
Thank you
Minimum SDK version specifies that you application will work on minimum that android version and above. It also helps application to be showed on market. So when you put minimum sdk version like 8, your application will work on minimum android version 8 and above.
It's recommended to choose the lower that you use in your application to your "minSdkVersion".
Generally I used the minSdkVersion 7 (= Android 2.1 Eclair) to reach a maximum of people. You can find a pie chart here.
When you develop, do not hesitate to increase your minSdkVersion if you used a new API, you can find the API levels for any methods in the Android reference.

how to run android app in lower api target emulator?

I had made an application with target : Android 2.1 - API Level7. It works fine with the emulator with target : Android 2.1 - API level7. And after that i tried to run the same app in an emulator with target : Android 1.5 - API Level3. But it is not working. I am using the Eclipse to built my application..
Can anyone say why it happens like this? Or, can anyone simply describe how to make changes to run an app build in API Level7 to 5 with steps.. I am new to this environment, i may be wrong with my procedures..
So plz guide me..
Use the min sdk version in your manifest file to Android 1.5 api level 3. Your api target version is still the same.
Add the following line in your AndroidManifest.xml file
<uses-sdk android:minSdkVersion="3" />
this will allow your app to run in any device with api level 1.5 or higher.
Set the minSDK to the lowest level you want to support, and the max to the highest level. The set the target to whichever makes sense.
In summary, look at this: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html.
You choose the min, target and max SDK in the manifest file.
android is backwards compatible, not forwards, so your target api should be the lowest version of android ynu would like your app to run on. your target api should be 1.5.
Yes as everyone said. Android minimum-sdk-version is trick for you question.
If you have target API 2.3.3 then minimum-sdk-version will be 10(By default).so it will run on 2.3.3, 3.1,3.3 and more which has minimum-sdk-version more than 10.
So if i change minimum-sdk-version to 4 it will work on device which have version more than 4.
No you have two solution --
1) change minimum-sdk-version in android-manifest
2) change target api
project->rightclick->properties->android then select Target API

Confused about Min SDK Version

I am referring to the http://developer.android.com/resources/tutorials/testing/activity_test.html regarding activity testing.
My avd is showing platform-2.3.3 api level-10.
In eclipse when i click on create new android project and select create project from existing source and then browse to the samples\android-8\Spinner it prefill the Min Sdk Version with 3 and when i select the target platform 2.3.3 api level 10 it shows following warning:
The API level for the selected SDK target does not match the Min SDK Version.
I have checked the spinner manifest file it contains
<uses-sdk android:minSdkVersion="3"/>
I have tried different combinations like changed the sample folder and changed the target but it shows the same warning.
I want to know how to rectify the warning so that my sample run?
Please help me on this
min sdk version can be lower than target sdk version.
see this link
The app uses level 10 sdk I guess and the minsdklevel specified is 3 that is the reason for the warning. This warning can be ignored.
You can run the app on any version of android with level >= 3 as long you dont use any api calls which where introduced in level 10.

Categories

Resources