Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with ActionBarActivityDelegate class.....app doesn't run

Hello i hope someone can help me with his I was planning to put an action bar in my test app, so I did exactly as said in the developers API guide.

But when i tried to compile it it throw this error (logcat):

java.lang.ExceptionInInitializerError
at android.support.v7.app.ActionBarActivityDelegate.createDelegate()
at android.support.v7.app.ActionBarActivity.onCreate().....
..... 
Caused by: java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$attr
at android.support.v7.app.ActionBarActivityDelegateBase.<clinit>

What happens is that the app is correctly installed into my phone but even before it shows any UI, it throws the error and closes.

I even tried with the most simple app ("hello world example") and says the same thing I tried it in both real phone and simulator, and same result

Any ideas how to fix that???? Seems that there is no definition for the class ActionBarActivityDelegateBase, but i cannot find any reference to that class in the guides or any other website

like image 717
Roberto Arias Avatar asked Jul 26 '13 20:07

Roberto Arias


3 Answers

I had that error, and the problem was that I hadn't added the lib with the resources. You can't just add the jars, because it will not add the resources. You have to create a project from thoses libs and then add the project as a library to your own project.

Here's the instructions how to:

Go to this link and go to the "Adding libraries with resources" section

http://developer.android.com/tools/support-library/setup.html

This fixed the problem for me.

Cheers

like image 165
clauziere Avatar answered Oct 14 '22 01:10

clauziere


I had the same issue about 20 minutes ago. I fixed it in the Manifest by changing the theme from "AppTheme" to "Theme.AppCompat"

<application
    ...
    android:theme="@style/Theme.AppCompat" >
like image 4
user2624395 Avatar answered Oct 14 '22 02:10

user2624395


I'm using Android-Studio 1.0.2 and I had the same problem. I fixed the issue removing compile 'com.google.android.gms' from build.gradle. Not too sure about the cause of the problem.

like image 1
tigerjack Avatar answered Oct 14 '22 03:10

tigerjack