更新Android Studio后出现奇怪的错误 [英] Strange error after updatng Android studio

查看:82
本文介绍了更新Android Studio后出现奇怪的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以离开我的Android Studio项目一段时间后,我运行了所有更新.

So after been away from my Android Studio project for a while I ran all updates.

我的构建gradle对此进行了定义

My build gradle defines this

compileSdkVersion 23

buildToolsVersion '23.0.1'

但是,现在当我全部重建时,我得到了错误:

However, now when I rebuild all I get error:

W:\ android-studio-projects \ sharedid \ app \ build \ intermediates \ res \ merged \ debug \ values-v24 \ values-v24.xml错误:(3)检索项目父项时出错:找不到资源匹配给定名称'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.错误:(4)检索项目的父项时出错:找不到资源匹配给定名称'android:TextAppearance.Material.Widget.Button.Colored'.错误:(3)检索项目的父项时出错:找不到与以下项匹配的资源给定的名称'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.错误:(4)检索项目的父项时出错:找不到资源匹配给定名称"android:TextAppearance.Material.Widget.Button.Colored".

W:\android-studio-projects\sharedid\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'. Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'. Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'. Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

这是文件-不是我创建的文件:

Here's the file - not one I have created:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="android:TextAppearance.Material.Widget.Button.Borderless.Colored"/>
    <style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button.Colored"/>
    <style name="TextAppearance.AppCompat.Notification.Info.Media"/>
    <style name="TextAppearance.AppCompat.Notification.Media"/>
    <style name="TextAppearance.AppCompat.Notification.Time.Media"/>
    <style name="TextAppearance.AppCompat.Notification.Title.Media"/>
</resources>

我在这里不了解的事情-这个错误似乎是由于Android库本身的问题引起的-与我的代码没有直接关系.

The thing I do no understand here - this error seems to stem from a problem in Android libraries themselves - and not related directly to my code.

由于我的编译SDK和构建版本没有更改-如何突然开始出现此错误?而我该如何解决呢?

Since my compile SDK and build versions have not changed - how can I suddenly start getting this error? And how do I solve it?

推荐答案

我也遇到了类似的问题,并通过覆盖违规样式对其进行了修复.通过这种解决方法,您可以使用build.gradle文件构建项目,该文件包含具有23.x.x支持库的API 23:

I had similar problem and fixed it by overriding the offending style. This workaround lets you build projects with a build.gradle file containing API 23 with 23.x.x support libraries:

compileSdkVersion 23
buildToolsVersion "23.0.3"
targetSdkVersion 23

compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'

创建res \ values-v24 \ styles.xml:

Create res\values-v24\styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
    <style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="android:TextAppearance.Material.Widget.Button" tools:override="true" />
    <style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button" tools:override="true" />
</resources>

这篇关于更新Android Studio后出现奇怪的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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