【发布时间】:2016-11-23 06:58:17
【问题描述】:
目前,我的 styles.xml 文件显示不正确。 Theme.AppCompat.Light.NoActionBar 无法解析。我已经重新启动了android studio,但它仍然无法正常工作。我尝试了使缓存无效/重新启动,但它不起作用。它不会使我的应用程序崩溃,而是为什么会发生。看下图:
这是我的 build.gradle 文件
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "xx.com.xxx.xxxx"
minSdkVersion 17
targetSdkVersion 23
versionCode 21
versionName "1.2.0"
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.afollestad.material-dialogs:core:0.8.5.1@aar') {
transitive = true
}
compile('com.mikepenz:actionitembadge:3.0.2@aar') {
transitive = true
}
compile project(':blurringview')
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.android.support:palette-v7:23.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.wdullaer:materialdatetimepicker:1.5.1'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'com.mikepenz:iconics:1.3.0@aar'
compile 'com.mikepenz.iconics:community-material-typeface:+@aar'
compile 'com.soundcloud.android:android-crop:1.0.0@aar'
compile 'org.apache.commons:commons-lang3:3.4'
...
}
...
}
【问题讨论】:
-
你能在这里显示你的 build.gradle 文件吗?
-
我假设您忘记在 build.gradle 中添加:compile 'com.android.support:appcompat-v7:XX.XX.XX'。观看此版本信息:developer.android.com/topic/libraries/support-library/…
-
没有@David。我有它。在我的 build.gradle 文件中是
compile 'com.android.support:appcompat-v7:23.3.0' -
好的,很抱歉错误指向...您是否已经尝试清理您的项目?请出示您的 build.gradle 文件
标签: android android-studio android-appcompat android-styles