在LIB支持appcompat_v7错误 [英] Error at lib support appcompat_v7

查看:164
本文介绍了在LIB支持appcompat_v7错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在图书馆appcompat_v7麻烦

据对路径误差

  

RES /值-V21 / styles_bas​​e.xml

和在线路75显示错误 - 在75至78:

 <样式名称=Base.Widget.AppCompat.ActionButton
          父=机器人:Widget.Material.ActionButton>
 < /风格>
 

在控制台:

  

家用/用户/工作区/ appcompat_v7 / RES /值-V21 / themes_bas​​e.xml:156:错误:错误:未发现的资源匹配给定名称:ATTR机器人:colorControlNormal。

和几个错误similares改变只是机器人:*

我该如何解决这个问题?

解决方案

好吧,我不知道,如果这是一个真正的解决方案,但这里是我的理论,我做了什么:

我的理论

更新Android的支持库版本的21后,我得到了类似的错误。看来,我的IntelliJ没有正确更新我的模块的资源,这指出了appcompat的服务目录。

此外,我有一些小部件和code,它直接指向可绘制在这些ressources。

但在Android的支持库谷歌的V21取消了对河洛主题的支持

因此​​,编译器抱怨找不到我的主题依赖的资源。

我所做

当编译

说实话,我真的不知道在我是怎么出来做这项工作。我想,我曾经做了一些重新启动和高速缓存清空等复制ressources到我的项目的文件夹等。当我的应用程序终于启动了,它看上去与众不同!当然,它有材料的主题,而不是的河洛的主题。

和不是万能的存活,这种转变。例如。操作栏是绿色的,而不是(我的主题),黑色(标准)。于是,我就回到一个老版本appcompat,而不是迁移我的整个应用程序,以材料。

既然你问我要我的解决方案,我张贴我做了什么为降级到appcompat V20。

降级到appcompat V20

  1. 在启动SDK管理器
  2. 下载的 Android的支持库
  3. 进入目录\ Android的SDK \演员\机器人\ m2repository \ COM \机器人\ SUPPORT \ appcompat-V7 \ 20.0.0 \安装了Android SDK中
  4. 提取从中的所有文件appcompat-v7-20.0.0.aar (这是一个zip文件),以库\ appcompat \ 在我的项目目录,之后我的目录 appcompat
  5. 添加了这些在我的IntelliJ模块,并提出我的项目依赖于该模块
  6. 恢复 Android的支持-V7-appcompat.jar 从我的git仓库V20
  7. 使用的回收appcompat罐子代替V21一个

步骤6的一个,我发现非常困难。我预计 classes.jar 从.aar文件设置为 Android的支持-V7-appcompat.jar ,但事实并非如此。我甚至不知道,在那里你可以从正确的版本获得 Android的支持-V7-appcompat.jar ,因为我没有发现它在库中。我不想从某处互联网下载。

我是幸运,这已经是我在正确的版本混帐。

现在我的应用程序编译和正确看去。希望这样做你的!

I am having trouble to at library appcompat_v7

It have error on path

res/values-v21/styles_base.xml

and at line 75 show error - below 75 to 78:

<style name="Base.Widget.AppCompat.ActionButton"
          parent="android:Widget.Material.ActionButton">
 </style>

at console:

home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:156: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.

and several error similares changing just the 'android:*'

How can I fix this?

解决方案

Ok, I'm not sure, if this a real "solution" but here is my theory and what I did:

My Theory

After updating the "Android Support Library" version 21, I got a similar error. It seems, my IntelliJ didn't update the resources in my module correctly, which pointed to the ressources directory for appcompat.

Furthermore, I had some widgets and Code that directly pointed to drawables in those ressources.

But in v21 of the Android Support Library Google dropped support for the Holo theme!

Hence, the compiler complains about not finding the resources my theme depends on.

What I did

When it compiled

To be honest, I'm not really sure in how I came out making this work. I guess, I used did some restarting and cache emptying etc. Copying ressources to my project's folder etc. When my app finally started, it looked different! Of course, it had the Material theme instead of the Holo theme.

And not everything survived this transition. E.g. the Action Bar was black (standard) instead of green (my theme). So I tried to go back to an old version of appcompat instead of migrating my whole app to Material.

Since you asked me for my solution, I'm posting what I did to "downgrade" to appcompat v20.

Downgrading to appcompat v20

  1. Start SDK Manager
  2. Download Android Support Repository
  3. Go to directory \android-sdk\extras\android\m2repository\com\android\support\appcompat-v7\20.0.0\ where Android SDK is installed
  4. Extract all files from appcompat-v7-20.0.0.aar (it's a zip file) to libs\appcompat\ directory in my project, after I created the directory appcompat
  5. Added these as a module in my IntelliJ and made my project depend on this module
  6. Recovered android-support-v7-appcompat.jar for v20 from my git repository
  7. Used the recovered appcompat jar instead of the v21 one

Step 6 is the one, I found very difficult. I expected the classes.jar from the .aar file to be the android-support-v7-appcompat.jar, but it wasn't. I even don't know, where you can get the android-support-v7-appcompat.jar from in the right version because I didn't find it in the repository. And I didn't want to download it from "somewhere in the internet".

I was "lucky", it already was in my git in the correct version.

Now my app compiled and looked correctly. Hope so does yours!

这篇关于在LIB支持appcompat_v7错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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