Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 1.2.1.1 - Failed to find style 'textViewStyle'

I'm new to Android development and I just installed Android Studio version 1.2.1.1. I created a project, HelloWorld, and chose the default blank activity, Darcula theme, and default API. Straight out of the box, without having written any code or touched anything, I get this message:

"Rendering Problems Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'textViewStyle' in current theme (4 similar errors not shown)."

I uninstalled and reinstalled Android Studio but I still get this error so I'm not sure what else I should do. It says "use the theme combo box... or fix the theme style references" and I'm new to Android Studio so I have no idea where the box is or how to change the reference.

like image 813
user2636417 Avatar asked May 20 '15 19:05

user2636417


2 Answers

Simply click on the Refresh icon at the review pane:

enter image description here

like image 195
Newton Sheesha Avatar answered Nov 15 '22 10:11

Newton Sheesha


Android gives you the option to define your own style format, which the default project you made did. It created a style named 'textViewStyle'.

If you look at the text view instead of the design view (you can switch by pressing the tab at the lower left in the part where you get the error that it can't render) you will see that the textView or the app itself contains a line android:theme="@style/textViewStyle".

You can either remove this line, or track down the error in the styles.xml file in the res/values folder. This is the file that defines the style for the app.

If this doesn't help you it could be that the style is defined in your AndroidManifest.xml file, look at the tag, it will contain a line saying android:theme="@android:style/textViewStyle", change that to android:theme="@android:style/Theme.DeviceDefault" and you should be good to go.

More info on custom themes: http://developer.android.com/guide/topics/ui/themes.html

Since you are a beginner, more on general Android development: http://developer.android.com

like image 6
Jeroen Pleysier Avatar answered Nov 15 '22 11:11

Jeroen Pleysier