1

Why is there error at android:minSdkVersion? And also how do I change the android:icon to default? I've tried android:icon="true" but it is wrong.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.testing"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" /> //Error : <uses-sdk> tag should specify a  
  target API level (the highest verified version; when running on later versions, 
 compatibility behaviors may be enabled) with android:targetSdkVersion="?"    


<application android:icon="true" android:label="@string/app_name"> //Error : Boolean   
types not allowed (at 'icon' with value 'true'). 
    <activity android:name=".LoginActivity"
              android:label="Login to your Account">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <!--  Entry for RegisterActivity.class -->
    <activity android:name=".RegisterActivity"
              android:label="Register New Account"></activity>

</application>
</manifest>
amln_ndh
  • 617
  • 2
  • 9
  • 30
  • You should mention android:targetSdkVersion and For App Icon You Should mention any image from drawable folder. Like android:icon="@drawable/ic_launcher" – Subramanian Ramsundaram Nov 09 '13 at 16:13
  • @SubramanianR I've already change it to android:icon="@drawable/ic_launcher". But then it states that **Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data)** – amln_ndh Nov 09 '13 at 16:19
  • Its working fine for me. Can you please share your edited new manifest file. – Subramanian Ramsundaram Nov 09 '13 at 16:27
  • "Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data)" -- that is another attribute that Lint is suggesting that you should have on your `` element. – CommonsWare Nov 09 '13 at 16:34
  • @SubramanianR this is my new manifest file. I just added the android:targetSdkVersion and change android icon to drawable – amln_ndh Nov 09 '13 at 16:37
  • @CommonsWare i dont really understand. Can you explain further? – amln_ndh Nov 09 '13 at 16:43
  • http://developer.android.com/guide/topics/manifest/application-element.html#allowbackup – CommonsWare Nov 09 '13 at 16:58

2 Answers2

1
  1. android-icon will be drawable type as it will be an image. Its not a boolean.
  2. Supply a target sdk version too e.g.,

    android:minSdkVersion="14" android:targetSdkVersion="17"

Bette Devine
  • 1,196
  • 1
  • 9
  • 23
1
android:icon=@drawable/ic_launcher

add this code to your uses-sdk

android:targetSdkVersion="17"

then go to project->clean->ok.

If that doesn't work it must have some internal error, to remove this follow the following steps:-

1.Delete the project.
2.Create new project.
Ajay
  • 4,773
  • 3
  • 23
  • 36
  • I've changed everything just like you mentioned. However there are still warning. And after I clean the warning disappear. So does this mean that my coding is okay now? Because I'm new to this and I'm not really sure – amln_ndh Nov 09 '13 at 16:40
  • Yes,coding is perfectly ok. Cleaning removes the .class files and recompiles the project. Basically, it forces a rebuild. For more clarity go to http://stackoverflow.com/questions/4549161/function-of-project-clean-in-eclipse – Ajay Nov 09 '13 at 16:55