【发布时间】:2014-11-18 08:02:06
【问题描述】:
最近我将我的 nexus 5 升级到了 Lollipop。我使用 AppCompat-21 创建了一个应用程序。 values-v21下的样式如下
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light">
</style>
</resources>
但是当我运行该应用程序时,它会因信息而崩溃:
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
这是我的 build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "geone.businspector"
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.0'
}
它在棒棒糖之前的设备下运行良好......
我搜索了很多,但没有好的解决方案。有人遇到过这个吗? ps:我使用的是 Android Studio 0.8.14,我是 Android Studio 的新手。谢谢。
【问题讨论】:
标签: android android-studio android-5.0-lollipop android-appcompat build.gradle