I’m trying to integrate abs into my app, but I keep getting this error about not being able to inflate com.actionbarsherlock.internal.widget.ActionBarContainer. Can anyone help?
“Styles.xml”
<resources>
<style name="AppTheme" parent="Theme.Sherlock.Light" />
</resources>
“activity_main.xml”
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
“Android Manifest.xml”
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.e.ffgh"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<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>
</application>
</manifest>
“MainActivity.java”
package com.e.ffgh;
import com.actionbarsherlock.app.SherlockActivity;
import android.os.Bundle;
public class MainActivity extends SherlockActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
08-26 06:13:36.442: E/AndroidRuntime(1464): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.e.ffgh/com.e.ffgh.MainActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class com.actionbarsherlock.internal.widget.ActionBarContainer
UPDATE: Slimmed down post. Started a BS project with just the bare minimum. It works on ICS, but still gives me the “Error inflating class com.actionbarsherlock.internal.widget.ActionBarContainer” error in Gingerbread or Froyo
I realized that the problem occurs whenever I fixed the warning in the ActionBarSherlock library. I didn’t think they would make a difference, but apparently they did. I haven’t further check what warning i fixed in the library that makes the compile go bad, but I think it is when I Suppressed the warning about “android.R.attr.animationResolution” being deprecated in the IcsProgressBar class. I will look into that later, but the point is, don’t mess with the ActionBarSherlock library when you import it.