ERROR: Application requires API version 14. Device

2019-02-02 14:20发布

I am following a tutorial for creating a simple application in Android, and compiling it with Eclipse on Linux.

The problem is that when I first created the project, I used the target API 14. But my tablet only has API 13, so I have changed it in project > properties > android to API 13. Even though I still get next the error:

ERROR: Application requires API version 14. Device API version is 13 (Android 3.2.1)

Why is this happening if I have changed the compilation target?

6条回答
倾城 Initia
2楼-- · 2019-02-02 14:29

Android creates the manifest with minSdkVersion, that doesn't change automatically when you change the properties.

Change the line inside Android manifest

<uses-sdk android:minSdkVersion="14" />

and put 13 instead of 14.

查看更多
欢心
3楼-- · 2019-02-02 14:29

Use as below or remove the entire line for auto detection of API level

<uses-sdk android:minSdkVersion="13"/>
查看更多
Luminary・发光体
4楼-- · 2019-02-02 14:37

Open AndroidMainfestFile.xml change the SdkVersion there.

查看更多
男人必须洒脱
5楼-- · 2019-02-02 14:44

Make sure that after updating API of your emulator the old version of the emulator should be shutdown if it is running. That was in my case.

查看更多
一夜七次
6楼-- · 2019-02-02 14:49

One thing to note. Be sure after you have made this change that you "Clean" your project and recompile or it will not take effect.

查看更多
可以哭但决不认输i
7楼-- · 2019-02-02 14:54

Here is an useful explanation of versioning in Android. Basically android enforces the system compatibility as expressed by the minSdkVersion in the manifest.

android:minSdkVersion — The minimum version of the Android platform on which the application will run, specified by the platform's API Level identifier.

查看更多
登录 后发表回答