当我启动我的应用程序时,我仅在 Lollipop 中遇到此崩溃。其他版本工作正常,例如4.4
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;
出了什么问题?
编辑1:
android:minSdkVersion="8"
android:targetSdkVersion="22"
值/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>
最佳答案
您正在使用 AppCompat 主题,因此您应该从 value-v21 中的主题内的命名空间中删除 android
而且它不需要 value-v21 样式。
关于android - 仅 Lollipop 崩溃 "Failed resolution of: Landroid/support/v7/appcompat/R$styleable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29434644/