Gintas_
Gintas_

Reputation: 5030

Lollipop only crash "Failed resolution of: Landroid/support/v7/appcompat/R$styleable"

I get this crash in Lollipop only, when I launch my app. Other versions work fine, e.g. 4.4

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;

pic1

pic1

what is wrong?

EDIT1:

android:minSdkVersion="8"
android:targetSdkVersion="22"

values/styles.xml:

<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <item name="colorAccent">@color/colorPrimary</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimary</item>
    <item name="android:windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:editTextStyle">@style/EditTextStyle</item>

</style>

<style name="AppTheme" parent="AppBaseTheme">
</style>
<style name="EditTextStyle" parent="Widget.AppCompat.EditText"/>
</resources>

values-v21/styles.xml:

<resources>
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <item name="android:colorAccent">@color/colorPrimary</item>
    <item name="android:colorPrimary">@color/colorPrimary</item>
    <item name="android:colorPrimaryDark">@color/colorPrimary</item>
    <item name="android:windowActionBar">false</item>
</style>

<style name="AppTheme" parent="AppBaseTheme">
</style>
</resources>

Upvotes: 2

Views: 2542

Answers (2)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364211

You are using a AppCompat theme so you should remove android from the namespace inside your theme in values-v21

Also it doesn't require a values-v21 style.

Upvotes: 2

Roberto B.
Roberto B.

Reputation: 3065

You are probably using the AppCompat library from the Android SDK directory. Just make a copy of the library folder and put it near your project, then re-import it to Eclipse from the new location.

Upvotes: 0

Related Questions