After setting up android-support-v7-appcompat R.java is missing

Remarkable picture Remarkable · Sep 2, 2013 · Viewed 33.5k times · Source

I am trying to change my Eclipse project to make it backward compatible to Android 2.1. I followed the instructions to set up the Support Library from here but after I attached the Library project to my project, the R.java from the gen directory gone.

Plus I got some errors in the console, like:

[2013-09-02 00:08:26 - gitarshopAndroidClient] /usr/local/external/android-sdk-linux/extras/android/support/v7/appcompat/res/values-v14/styles_base.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar'.
[2013-09-02 00:08:26 - gitarshopAndroidClient] /usr/local/external/android-sdk-linux/extras/android/support/v7/appcompat/res/values-v14/styles_base.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar'.
[2013-09-02 00:08:26 - gitarshopAndroidClient] /usr/local/external/android-sdk-linux/extras/android/support/v7/appcompat/res/values-v14/styles_base.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.Solid'.

Any idea?

Answer

Remarkable picture Remarkable · Sep 3, 2013

Okay, I figured out what was the problem.

The build target of my project was Android 2.1 (API 7). I had to target Android 4.0 (API 14) at least to get rid of the warning message.

YOUR APP WILL STILL RUN ON Android 2.1 DEVICES! This is what I missed whan I set up the target wrongly.