Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application does not specify API level

I am just beginning to use Eclipse for Android applications. I have installed Eclipse 3.5.2 and Java 5 AVD is Android 2.1 API 7

My initial Hello Android program ran fine but will not run again.

getting the following error:

[2010-07-25 09:47:31 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-07-25 09:47:31 - HelloAndroid] Device API version is 7 (Android 2.1-update1)

searched the forums but could only find a refernece to manifest file to be sure following was set:

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

my manifest file does not contain that line:

 <?xml version="1.0" encoding="utf-8" ?> 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.helloandriod" android:versionCode="1" android:versionName="1.0">
     <application android:icon="@drawable/icon" android:label="@string/app_name">
         <activity android:name=".HelloAndroid" android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" /> 
                 <category android:name="android.intent.category.LAUNCHER" /> 
             </intent-filter>
         </activity>
     </application>
  </manifest>

I have checked the adv mgr and it is set to 7 In Eclipse i went to properties -> Android and set it to 7

get same warnings

like image 310
Trent Avatar asked Jul 25 '10 16:07

Trent


People also ask

What is an API level?

What is API Level? API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform. The Android platform provides a framework API that applications can use to interact with the underlying Android system.

Is API level and SDK are same?

It is defined in build. For example, if you set the minSdk to 30, an SDK version corresponds to API Level 30 and Android 11. It makes your app run only on devices with Android 8 or higher versions.

What API level should I develop for Android?

When you upload an APK, it must meet Google Play's target API level requirements. New apps must target Android 12 (API level 31) or higher; except for Wear OS apps, which must target Android 11 (API level 30) or higher.


2 Answers

Well, if Eclipse is, for whatever reason, not generating that line for you, by all means you can add it yourself.

Add the line:
<uses-sdk android:minSdkVersion="3" />

to your manifest, right before the ending manifest tag.

like image 125
nicholas.hauschild Avatar answered Sep 16 '22 16:09

nicholas.hauschild


You should also include

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

in your manifest file, if it is not already there. It's not clear from your question, but seems that it isn't.

For future reference about API levels, see this page

like image 25
chrisbunney Avatar answered Sep 16 '22 16:09

chrisbunney