andrew
andrew

Reputation: 3141

Change min SDK from 4.1 to 2.2 - style.xml (resource)

I want to change min SDK from 4.1 to 2.2 android. So I have changed in properties "Project Build Target" to 2.2 version, fix some problem (e.g. adView.setY();-makes error) and I now have problem with style.xml. I didn`t change anything in style.xml before and after changing sdk but now I have error like that:

error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.    styles.xml  /SquaresUpdate/res/values-v14   line 3  Android AAPT Problem

in both files styles.xml (values-v11 and values-v14). Styles.xml:

<resources>
<style name="AppTheme" parent="android:Theme.Holo.Light" />
</resources>

Manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="mypackage"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

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

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".gui.MainActivity"
            android:label="@string/title_activity_main"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.google.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
        <activity
            android:name=".GameActivity"
            android:label="@string/title_activity_game"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
        </activity>
        <activity
            android:name=".gui.SettingsActivity"
            android:label="@string/title_activity_settings"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
        </activity>        
        <activity
            android:name=".gui.TheBestScoreActivity"
            android:label="@string/title_activity_the_best_score"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
        </activity>
        <activity
            android:name=".gui.AboutActivity"
            android:label="@string/title_activity_about"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
        </activity>
    </application>

</manifest>

Before changing to 2.2 sdk version application was good.

Upvotes: 1

Views: 3924

Answers (3)

ruben
ruben

Reputation: 1750

You didn't accept the answer. Just thought it might be helpful for others:

You can change the style.xml as follows for both folder (values-v11 and values-v14).

<resources>
<style name="AppTheme" parent="android:Theme.Light" />
</resources>

And in the menu.xml delete the attribute android:showAsAction="never" and it should work for lower android versions too.

Upvotes: 1

Stefan de Bruijn
Stefan de Bruijn

Reputation: 6319

Android doesn't have the holo theme at all until 3.0

You'll have to use another standard theme when below 3.0 or backport these styles. A good library for this is HoloEverywhere. Give it a good thought however if you really want to use this - There is nothing wrong with using the style that belongs to the Android version and device the app is used on.

Upvotes: 1

Melih Mucuk
Melih Mucuk

Reputation: 7066

Approximately Android 2.2 does not support your apps requirements. I think, you might use some new controls and components. For example I use web service in my app, It works on 2.2, but It doesn't work on 4.0 or higher. Because android 4.0 or higher required use asynctask for this process. Something like that. You should check which features you can use on which version from android developers site.

Otherwise, clean your project and restart IDE. I hope this fix your problem.

Upvotes: 0

Related Questions