when I tried to add

android:installLocation="auto" 

in my AndroidManifest.xml file I found the following error in eclipse

error: No resource identifier found for attribute "installLocation" in package "android"

how to overcome this problem ?

edited :

My Manifest file is :

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="auto"
    android:versionCode="1"
    android:versionName="1.0" 
    package="com.xxxx.yyyy">

        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    <application
        android:label="@string/app_name" android:icon="@drawable/icon">

    <activity
        android:screenOrientation="portrait"
        android:name=".StarterActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action
                android:name="android.intent.action.MAIN" />
            <category
                android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
    android:screenOrientation="portrait"
        android:name="GamePlayActivity"></activity>

                <activity
    android:screenOrientation="portrait"
        android:name="LoginActivity"></activity>

                <activity
    android:screenOrientation="portrait"
        android:name="SignupActivity"></activity>

    <activity
    android:screenOrientation="portrait"
        android:name="MainMenuActivity"></activity>
    <activity
    android:screenOrientation="portrait"
        android:name="InfoActivity"></activity>

    <activity
    android:screenOrientation="portrait"
        android:name="ViewScoreActivity"></activity>    



    <activity 
    android:name="com.google.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation"></activity>

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


</manifest> 

error is showing in line android:installLocation="auto"

Thanks

share|improve this question
    
whats your application's minSDKVersion? – user370305 Oct 13 '11 at 7:36
    
i've added the manifest @user370305 – fean Oct 13 '11 at 7:48
    
minSdkVersion="7" – fean Oct 13 '11 at 7:49
    
and what about if you try it on android:minSdkVersion="8" or greater. – user370305 Oct 13 '11 at 7:49
1  
change your application's api version from properties make it 8 or greater. then its work fine. Look at my edited answer. – user370305 Oct 13 '11 at 8:06
up vote 15 down vote accepted
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
    . . .
</manifest>

Introduced in: API Level 8.

Backward Compatibility

The ability for your application to install on the external storage is a feature available only on devices running API Level 8 (Android 2.2) or greater. Existing applications that were built prior to API Level 8 will always install on the internal storage and cannot be moved to the external storage (even on devices with API Level 8). However, if your application is designed to support an API Level lower than 8, you can choose to support this feature for devices with API Level 8 or greater and still be compatible with devices using an API Level lower than 8.

To allow installation on external storage and remain compatible with versions lower than API Level 8:

  1. Include the android:installLocation attribute with a value of "auto" or "preferExternal" in the element.
  2. Leave your android:minSdkVersion attribute as is (something less than "8") and be certain that your application code uses only APIs compatible with that level.
  3. In order to compile your application, change your build target to API Level 8. This is necessary because older Android libraries don't understand the android:installLocation attribute and will not compile your application when it's present.

When your application is installed on a device with an API Level lower than 8, the android:installLocation attribute is ignored and the application is installed on the internal storage.

Caution: Although XML markup such as this will be ignored by older platforms, you must be careful not to use programming APIs introduced in API Level 8 while your minSdkVersion is less than "8", unless you perform the work necessary to provide backward compatibility in your code. For information about building backward compatibility in your application code, see the Backward Compatibility article.

share|improve this answer
    
Thanks, it works fine now – fean Oct 13 '11 at 8:52

==> go to eclipse project settings -> SEction "Android" and select at least API Level 8 there.

referenced by user "user370305" as comment: change your application's api version from properties make it 8 or greater. then its work fine. Look at my edited answer. – user370305 Oct 13 '11 at 8:06

thx && good luck! :=)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.