I am trying to implement the new ActionBar support library that was released by Google a couple days ago. In the past, I have successfully implemented ActionBarSherlock wit
If, like me, you are following the Android tutorial on http://developer.android.com/training/basics/actionbar/setting-up.html and keep getting this error, try to change the AppBaseTheme
style in all styles.xml
files. In detail:
In file res/values/styles.xml
change the line:
<style name="AppBaseTheme" parent="android:Theme.Light">
to:
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
In file res/values-v11/styles.xml
change the line:
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
to:
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
In file res/values-v14/styles.xml
change the line:
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
to:
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
Now the application should run fine.
This is an issue that can happen in Android Studio if you modify Project Structure Modules. In this case you may need to add the dependencies again. In a text editor edit the 'build.gradle' file to include the required dependencies:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
This should update your '{your_project_name}.iml' file with lib components:
<orderEntry type="library" exported="" name="appcompat-v7-19.0.1" level="project" />
You had better make new project with any name , then use appcompat_v7 that program make new .
Right Click Project-> properties->Android
In the section library Add
and choose library appcompat.
Forget everything. Just use the appcompat library downloaded using the Android Studio. It has all the missing definitions. No matter whether you are using in Eclipse or not.
I will share my experience with this problem. I was going crazy because of this, but I found out that the problem was a bug with Eclipse itself, rather than my code: In eclipse, unable to reference an android library project in another android project
So, if you have the Android Support Library in your C: drive and your project in the D: drive on your computer, Eclipse won't function correctly and won't know where the Android Support Library is (green tick turns into red cross). To solve this, you need to move both projects onto the same hard drive.
I dont know how many of you noticed this. Support library "appcompat_v7" and your project should be in a same directory(I mean workspace directory). Dont clean your project until its error free else you will have tough time with R.java