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
I made a really silly mistake for this. When I was getting same error every time i could not figure out what was wrong. then it clicked me that once I have closed all the projects in my work space and that was the time since all the problems started. SO just check whether your "appcompat_v7" is not closed. If it is then open the project by double click and then clean and build your project again. In my case the errors were gone. Happy coding!
I did the following in Eclipse with the Android Support Library (APL) project and the Main Project (MP):
Ensured both APL and MP had the same minSdkVersion
and targetSdkVersion
.
Added APL as a build dependency for MP:
Going into "Properties > Java Build Path" of MP, and then
Selecting the "Projects" tab and adding APL.
In the properties of MP, under "Android", added a reference to APL under library.
1 and 2 got the references to Java classes working fine...however I still saw the error in the manifest.xml
for MP when trying to reference @style/Theme.AppCompat.Light
from APL. This only went away when I performed step 3.
I had same problem and waste my 4-5 hours for solution. My problem solved with;
Hope you will find your solution.
For Android Studio or IntelliJ, all you need to do is update your dependencies in gradle.build. I used the following:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
}
in eclipse right click on your project-> select build path and then select configure build path. from the window select the jar file that you want and refresh your project
In my case the problem occurred since I wanted to use a SDK that doesnt include the required library. When I increased the min. SDK level the problem dissappeared. Of course directly including the library's itself, should remove the error as well.