I am using Android Studio and trying to use ActionBarActivity
instead of Activity
. Unfortunately when my main Activity
tries to invoke ActionBarActivity
I get an error:
Caused by: java.lang.NoClassDefFoundError:
I have added proper style to both activities
:
android:theme="@style/Theme.AppCompat.Light">
.
What am I missing, to have this working in Android Studio?
Adding the support
and appcompat
libraries to Gradle
was not enough. I also had to add those libraries to Project structure
as dependencies. This is confusing, because code compiles, but then crashes at runtime.