我的风格有什么问题?无法解析符号 Theme.AppCompat.Light.NoActionBar [英] What wrong with my Style? cannot resolve symbol Theme.AppCompat.Light.NoActionBar

查看:120
本文介绍了我的风格有什么问题?无法解析符号 Theme.AppCompat.Light.NoActionBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我的styles.xml 文件显示的内容不正确.Theme.AppCompat.Light.NoActionBar 无法解析.我已经重新启动了 android studio,但它仍然无法正常工作.我尝试了使缓存无效/重新启动,但它不起作用.它不会使我的应用程序崩溃,而是它发生的原因.看下图:

Currently, my styles.xml file show something not properly. Theme.AppCompat.Light.NoActionBar cannot be resolve. I have restart android studio but it still not work. I tried Invalidate Caches/Restart, but it not work. It doesn't make my app crash, but why It occurs. Look below image:

这是我的 build.gradle 文件

This is my build.gradle file

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'
     ...
}

...
}

推荐答案

最后,这是我的第一个解决方案.发生错误是因为 gradle 不适用于版本较低的库.它不编译外部库 appcompat-v7:23.3.0.我现在要做的是将 gradle 插件从 2.+ 降级到 2.2.0 和 rebuild 项目.现在又可以用了.

Finally, here is my first solution. The error happen because gradle not work with the libraries which has lower version. It doesn't compile the external library appcompat-v7:23.3.0. What I do now is downgrade gradle plugin frorm 2.+ to 2.2.0 and rebuild project. It works again now.

此链接显示了如何降级版本 gradle [链接].

This link show how to downgrade version gradle [Link].

这不是一个好主意,我想,但它确实解决了我的问题.

It is not a good idea, thought, but It did saved my problem.

任何其他改进的想法或意见,欢迎.

Any other ideas or comments to improve, welcome.

这篇关于我的风格有什么问题?无法解析符号 Theme.AppCompat.Light.NoActionBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆