0

I created an Android Project in Eclipse Luna targeting API 22 and the minimum sdk was set to API 8, when I tried to open the activity_main xml file, the rendering worked fine for all other versions(shown below in first screenshot) but 22(second screenshot) For API 21 enter image description here

And the error logs are in the second screenshot. I am just trying out Android development and I am really confused. Does anyone know if this is a problem I caused or is it a bug? Thanks a bunch.

The error log:

Failed to find the style corresponding to the id 2130772026

Failed to find the style corresponding to the id 2130771996

java.lang.NullPointerException

Exception details are logged in Window > Show View > Error Log

The following classes could not be instantiated:

-android.support.v7.internal.app.WindowDecorActionBar (Open Class, Show Error Log)

See the Error Log (Window > Show View) for more details.

TPWang
  • 1,322
  • 4
  • 20
  • 39
  • Better to Jump on `Android Studio`. – M D May 27 '15 at 11:45
  • Why's that? I've seen a lot of people using Eclipse. And the tutorial I found was using Eclipse. – TPWang May 27 '15 at 11:46
  • Sooner or later you will have to start using android studio since it is the official ide now. So if you are a beginner i advise you find some tutorials using android studio. – yrazlik May 27 '15 at 11:49
  • Try this: http://stackoverflow.com/questions/29824136/activity-main-xml-failed-to-find-the-style-corresponding-to-the-id-2130771996 – Genaut Aug 08 '15 at 19:04

3 Answers3

2

Another solution is there. Go to style.xml and write this item in appcompat.light parent style.

<style name="AppCompatTheme" parent="@style/Theme.AppCompat.Light">
    <item name="windowActionBar">false</item> 
</style>
Yeahia2508
  • 7,526
  • 14
  • 42
  • 71
0

Check whether required things are installed or not specially related to API level 22 using sdk manager and restart both sdk manager and IDE.

0

Make your Activity extend Activity by importing android.app.Activity; It will solve the problem and remove appcompat7 reference from main_Activity

MAdhav
  • 1