Home » Android » android – activity_main.xml: Failed to find the style corresponding to the id 2130771996

android – activity_main.xml: Failed to find the style corresponding to the id 2130771996

Posted by: admin June 15, 2020 Leave a comment

Questions:

I am Having trouble while creating new project in Eclipse Luno.
After I update Android Eclipse SDK to API 22 then I am start getting this issue,
Layout is not showing properly in Graphic Layout of activity_main.
This is Image Link of How its look When I create New Project

to show layout I need to transfer it to into API 20 then it works.
Errors are just showing in Error Log not in Problem section.
This is Error Log

Any Help Please.

P.S. It is OK when i select API Level 20 then Layout is totally fine and normal no errors.

How to&Answers:

Try changing to lower version as shown in image below and it should work:

enter image description here

Answer:

I found it
i had same problem
go to values/styles.xml
change theme to Base.Theme.AppCompat.Light.DarkActionBar or anything you want

Before :

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>
</resources>

After :

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme parent="Base.Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>
</resources>

Answer:

I did a configure build path including the andriod 5.1.1 library and then did a restart of eclipse and this error got resolved

Answer:

you only need to change the AppTheme to other theme that is way i resolve this.

Answer:

You can solve this problem also by just changing your theme from default app theme. I have solve tin this way only.

Answer:

change the API level mentioned above in xml file thats it

Answer:

The easiest solution is to change the theme from the drop down of the same page where we are getting the error, i.e in the graphical layout of the activity screen, in the top there is a drop down to change the theme. This solved the problem for me.

Answer:

Try to rebuild your project ..this work fine for me..
In the menu bar
Build->Rebuild
Or
add import app.studentlog.R; in your java file.where studentlog is your project name.

Answer:

Try to rebuild the project, It’ll work fine.

Answer:

You can just solve it by changing the app theme. I did the same and got it resolved