• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android Studio broken? Says missing class... no matter what project I start.

Hi,
I am new to software development.
Have been working in Android Studio slowly but getting somewhere, until yesterday.

I had to install the "Intel Hardware Acceleration" package, in order to be able to run emulators within my Apple laptop. Once I did this, it worked for a time.

Then, I got the following message:

NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views.
Fix compilation problems first.

The following classes could not be instantiated:

- android.support.v7.internal.widget.ActionBarOverlayLayout

Exception details
java.lang.NoClassDefFoundError: Could not initialize class.

etc...

What does this even mean? I had the simplest of software "apps" : one full size image button, which I was in the middle of learning how to make it play one small sound sample (doing this in Android, this is horrifically complicated, BTW) And the preview had the image button displayed correctly, and everything was "compiling" properly.

This is horrible. I cannot work in ANY new projects: I created new projects, empty ones, ones from templates, ones with lower Android versions, all sorts of things, and it gives me this error EVERY TIME.

Thank you for any help you can give me. I am just too confused by this sudden error. I have no idea why it is happening.

Here is the "stack" :

java.lang.ClassNotFoundException: android.support.v7.appcompat.R$attr

at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:127)

at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:53)

at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:84)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

at android.support.v7.internal.widget.ActionBarOverlayLayout.<clinit>(ActionBarOverlayLayout.java:149)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:413)

at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)

at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:177)

at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:214)

at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:142)

at android.view.LayoutInflater.inflate(LayoutInflater.java:482)

at android.view.LayoutInflater.inflate(LayoutInflater.java:414)

at com.android.layoutlib.bridge.bars.BridgeActionBar.<init>(BridgeActionBar.java:84)

at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:56)

at com.android.layoutlib.bridge.impl.RenderSessionImpl.createActionBar(RenderSessionImpl.java:1691)

at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:362)

at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)

at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)

at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:497)

at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:485)

at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)

at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:485)

at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:590)

at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:644)

at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:79)

at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:586)

at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)

at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)

at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)

at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)

at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)

at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:581)

at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)

at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)

at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)

at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)

at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)

at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)

at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)

at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

at java.lang.Thread.run(Thread.java:695)
 
I'm going to try to fix this by installing the rest of the "SDK" packages... since I am targeting an older Android version... 4.3 or something.

I still do not understand how a project which compiles fine and opens in the emulator, decides to not work anymore, and furthermore, how Android Studio now gives that error message no matter what project is open.
 
Hi,

I started a brand new, clean project, based on the Developer tutorial page here:

https://developer.android.com/training/basics/firstapp/index.html

And now I get this error message, very similar to the one I posted earlier:

Rendering Problems
The following classes could not be instantiated:

- android.support.v7.internal.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE

Exception Details
java.lang.NoClassDefFoundError: android/support/v7/internal/widget/ActionBarOverlayLayout$1
at android.support.v7.internal.widget.ActionBarOverlayLayout.<init>(ActionBarOverlayLayout.java:93)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at com.android.layoutlib.bridge.bars.BridgeActionBar.<init>(BridgeActionBar.java:84)
at com.android.layoutlib.bridge.bars.AppCompactActionBar.<init>(AppCompactActionBar.java:56)

So, what is going on?

This is very frustrating. I cannot evne learn how to code when this happens.

And I did try "Eclipse" with the Android plug in. That is completely confusing to me. All text, no previews at all. LOL, I cannot work like that when creating anything. I need visual feedback in order to know what is happening.
 
So, I opened Eclipse, and tried to start a new empty project. Eclipse Juno version:

Eclipse IDE for Android Developers 23.0.2.1259578 adtproduct null

Eclipse Platform 4.2.2.M20130204-1200 org.eclipse.platform.ide null

And tried to create a new empty project. With the default settings.

And... IT ALSO DOES NOT WORK.

What is going on with my computer? This is just horrible.

The fun thing is: I built this exact same software already for iOS iPhone. And it was EASIER. The application XCode never gave me this much trouble.
 
I found this bug report... so no easy fix yet:

Can't Render Layouts in Android Studio 1.2
The specific render error message is:

The following classes could not be instantiated:
- android.support.v7.internal.widget.ActionBarOverlayLayout


This 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
 
I tried their first workaround... I got it to work... after attempting this workaround like 4 times.

Note to the creators of Android Studio:

I HATE TROUBLESHOOTING YOUR SOFTWARE.

If it does this again, I'll report back.
 
Well, now it renders for new projects.
But not for my old project.

LOL. This is not the way I envisioned doing software programming.
 
hello, this is solution

Try changing your base application theme using below code - in res/values/styles.xml

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

for my this good solution
 
hello, this is solution

Try changing your base application theme using below code - in res/values/styles.xml

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

for my this good solution

Hi Daniel Ruiz.
Clearly, you did not read any of my previous post answers for the solution.
Thanks.
 
Back
Top Bottom