Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialanjalisaha
2,463 Pointsactivity_fun_facts.xml Exception raised during rendering: java.util.Locale.toLanguageTag()Ljava/lang/String;
Did an update to get Studio beta 0.8.6 and when I open up the fun facts application I get the error above when trying to see the design perspective on activity_fun_facts.xml. I am able to run the application on the an Android 4.4.2 API 19 simulator.
2 Answers
James Simshaw
28,738 PointsHello,
There are a few things that could cause this.
1) There have been some issues with Android Studio and the Android SDK in the past, you could try updating to the latest versions of both Android Studio and the SDK(avoid API 22 and the preview API 22 for M as well as build tools 22, use 21 for all of these as there's a few other issues occurring with those that I don't know if they're fixed yet)
2) This stackoverflow post mentions that if you have string literals in your layout's xml, it could cause this issue and to fix it you just need to put all string literals in your strings.xml file.
3) This stackoverflow post indicates that you might be able to solve this by changing what you are rendering to(a common mistake being set to render for Android Wear devices when developing for phones/tablets). To change this just make sure there isn't a W in the API version that you are rendering for.
Please let us know if any of these fixed your problem or if you need more assistance. If one of these did solve your problem, please let us know which one so anyone having this problem in the future could try that solution first.
anjalisaha
2,463 PointsThis is bug 170841 which will be fixed in version 1.2.3 of the Android Gradle plugin.
Workaround 1: First manually build the project, then manually sync the project (using the Sync with Gradle files in the toolbar, or from the Tools > Android menu), then finally press Refresh in the toolbar above the layout editor. Workaround 2: Switch the Android Gradle plugin from 1.2.x to 1.1.3 for now. When 1.2.3 is released you can switch back to the 1.2.x versions.
http://tools.android.com/knownissues#TOC-Can-t-Render-Layouts-in-Android-Studio-1.2
Auguste Compaore
9,297 PointsThis worked fine. Thank you ;)
anjalisaha
2,463 Pointsanjalisaha
2,463 PointsYes, I updated the Studio to the latest version and defaulted to API 21, this resolved the issues with the layout design rendering issue as API 22 was giving me issues. Thanks so much!
James Simshaw
28,738 PointsJames Simshaw
28,738 PointsYou're welcome. Have fun with Android development.