user2636417
user2636417

Reputation: 2477

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.

Upvotes: 34

Views: 50449

Answers (6)

ArtHare
ArtHare

Reputation: 1836

Rebooting Android Studio did the trick for me. I couldn't find the "Refresh" button in the accepted answer for some reason.

Upvotes: 0

Srneczek
Srneczek

Reputation: 2193

Go to manifest file, check the theme you are using there and pick the same in the Design view of your xml file.

Upvotes: 1

Newton Sheesha
Newton Sheesha

Reputation: 1245

Simply click on the Refresh icon at the review pane:

enter image description here

Upvotes: 122

Micro
Micro

Reputation: 10891

Make sure to select the correct theme from the menu in the preview panel.

If you set the layout file to be FullScreen in the manifest but select something like NoActionBar theme in the preview panel, you will also get this error.

Upvotes: 6

Jeanne Merle
Jeanne Merle

Reputation: 37

Click on "Design" tab

On the right pannel, search for the objet "text" that contains something like "@string/hello_world"

Remove this value from the field

There's no more error.

Upvotes: -1

Jeroen Pleysier
Jeroen Pleysier

Reputation: 151

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

Upvotes: 6

Related Questions