Working on versions 4.0.3 and 4.1, but Error 2.1.2.2 and 2.3 - Sherlock’s Action Bar

I followed one of the simplest tutorials, Barlock Sherlock. I followed every step. The problem is that I get an error in versions 2.1 through 2.3 and works fine from 4.0 to 4.1.
I am using Android SDK tools 20.0.3, and Eclipse version 4.2.0

setContentView(R.layout.activity_main);

The above code says R cannot be resolved to a variable. and a few more errors:

 [2012-09-04 22:18:21 - Action Bar demo] C:\Users\Karthick\Desktop\Project libs\JakeWharton-ActionBarSherlock-88fc341\library\res\values-v14\abs__styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar'.
    [2012-09-04 22:18:21 - Action Bar demo] C:\Users\Karthick\Desktop\Project libs\JakeWharton-ActionBarSherlock-88fc341\library\res\values-v14\abs__styles.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.Solid'.
    [2012-09-04 22:18:21 - Action Bar demo] C:\Users\Karthick\Desktop\Project libs\JakeWharton-ActionBarSherlock-88fc341\library\res\values-v14\abs__styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar'.
    [2012-09-04 22:18:21 - Action Bar demo] C:\Users\Karthick\Desktop\Project libs\JakeWharton-ActionBarSherlock-88fc341\library\res\values-v14\abs__styles.xml:10: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid'.

For a better understanding, here are some images:

enter image description here

enter image description here

My manifest file:

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

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET"/>

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

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".Google"></activity>
</application>  

Can someone help me fix these errors in Android 2.3

The same code works fine in Android 4.0.3

+5
source share
2 answers

, 2.1 2.3 4.0 4.1.

= > , 4.0 4.1, 2.x, , ActionBarSherlock .xml:

styles.xml , :

<style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar"/>

values-v11 values-v14 styles.xml, styles.xml :

<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar"/>
+5

, . -, Android 4.0.3, 2.3 Android. 2.3 minSDKVersion . -, , , ActionBarSherlock?

0

All Articles