Rendering Problems in Android Studio 1.5

+4 Ayush Verma · December 11, 2015
I am following Android App Development Tutorial using Android Studio of the newboston.
I am stuck on the 4th tutorial.
I am facing rendering problems like 
Following Classes could not be instantiated
   - android.support.design.widget.CoordinatorLayout
(PROPER SCREEN SHOT OF ERRORS ATTACHED)
 
NOTE :--
I have already updated my ANDROID STUDIO and its various packages and libraries. Still not able to correct the errors.


Help would be really appreciated.

Hoping for a swift response.
/images/forum/upload/2015-12-11/183fc8ed85fe1d72a16001b724e679f8.png/images/forum/upload/2015-12-11/176848c105a95f38792067995f0a3fbe.png

Post a Reply

Replies

Oldest  Newest  Rating
0 Derrick Lee · December 12, 2015
/images/forum/upload/2015-12-12/9e52ca5048e3e0067affcf45ec5e1aec.PNG

I also had the same issue, I've tried to change the API lower and also the style.xml, both of this doesn't work for me and I am still stuck with the rendering problem. I wanted to try the overflow menu exercise..Please help out too.
0 Sirius Black · December 15, 2015
Solution 1 - 

Go to Tools - > Clean Project
Tools > Rebuild Project

One of the Possible Reason: sometimes android studio gradle build cannot finish building properly or Its just android studio being silly!


Solution 2- Change your API Level in Preview window:

/images/forum/upload/2015-12-15/17b165d2a486c9640622449c8d5e9d39.PNG
Then again repeat Solution 1.

One of the Possible Reasons: your chosen SDK does not have necessary documentation.

Solution 3 -(Most common Solution)  Check your dependencies in your gradle file : 

/images/forum/upload/2015-12-15/7b62de77e414f1f3f8e7d21025dbcb83.PNG

Then Sync your project.


Reason: CoordinateLayout, Material design, AppBarLayout - these are relatively new features...so you have to put support libraries if your minimum SDK is less than API 21.

Solution 4- If you have updated Android Studio Recently,then you should download this library from SDK manager of android.

/images/forum/upload/2015-12-15/a9d81e84e4ba251a87d7c248ca273a8e.PNG
Reason: "Preview Channel" needs latest tools to preview your layout screen.

(Hope this helps...i faced similar problems..following one of the steps above solved it for me...i hope it does for you too!)
+1 Gary Whitney · December 15, 2015
I really like Sirius's answer but would like to add a caution about  following code examples.

You always start with a blank activity that extends AppCompatActivity if your min API is lower than the latest.
This in turn sets the theme and dependencies.

If you change the extends to match the example you are following, you just changed the requirements needed to support your Activity e.g. dependencies, themes, etc.
For example the Blank Activity starts with a toolbar but your example was written when ActionBars were the standard.

You may not have to change your activity from the default AppCompatActivity to follow the example.
0 Kent Godfrey · December 15, 2015
Same error here... I have tried downgrading to API 21 and Invalidating caches/restarting. Here is a screenshot:/images/forum/upload/2015-12-14/05938521861a4831d3fa0db7fbc49a22.PNG
0 Kent Godfrey · December 15, 2015
Ok i found a solution. I dont know how it works but it does.  Try deleting tools:showIn="@layout/activity_main" from the main xml file . It worked for me!?

to locate this go to the left side panel and go to app/res/layout/active_main.xml. Delete it and it will work.

Hope this works!!
0 abiral agarwal · December 15, 2015
/images/forum/upload/2015-12-15/368479419a81faffaa5da8fd1c6d8cbc.PNG
+1 Gary Whitney · December 16, 2015
I spent some time on this today. I uninstalled Android Studio (AS) and installed the latest version, Marshmallow  to see what new users were experiencing.
After the install and the updates I created a Blank Activity and an Empty Activity.

The Blank activity uses toolbars. With the app theme NoActionBar.. IF you change this to with ActionBar, but then the preview gave rendering errors. – Can’t find Class android.support.v7.internal.Window.Décor.ActionBar.
That is because Marshmallow uses ToolBars.

The Empty Activity doesn't use ToolBar it uses ActionBar. I would change the Preview to use API 21 and use this when following Bucky's tutorials because he was using API21 at the time.
0 pankaj gupta · December 28, 2015
try this up it worked for me!!! :)/images/forum/upload/2015-12-26/f2ad9ad35fc26fc638c0972b39e622f2.png
0 pankaj gupta · January 21, 2016
http://stackoverflow.com/questions/27501941/add-new-activity-without-menu-or-action-bar-in-android-studio
  • 1

Java / Android Development

107,215 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator