AppCompat v7 r21在values.xml中返回错误?
我正在使用Android Studio,当我将compile "com.android.support:appcompat-v7:21.0.0"
添加到我的Gradle文件时,出现了很多错误:
C:\Users\WindowsSucks\AndroidStudioProjects\MMMeds\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0\res\values-v11\values.xml Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. C:\Users\WindowsSucks\AndroidStudioProjects\MMMeds\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0\res\values-v14\values.xml Error:(9, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. Error:(9, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. Error:(9, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. Error:(9, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'. C:\Users\WindowsSucks\AndroidStudioProjects\MMMeds\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0\res\values-v21\values.xml Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'. Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'. Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.ActionBar'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Dark'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Dark.ActionBar'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Light'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'. Error:(298, 21) No resource found that matches the given name: attr 'android:overlapAnchor'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'. Error:(298, 21) No resource found that matches the given name: attr 'android:overlapAnchor'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Dialog'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. Error:Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.Dialog'. Error:(144, 21) No resource found that matches the given name: attr 'android:colorAccent'. Error:(146, 21) No resource found that matches the given name: attr 'android:colorControlActivated'. Error:(147, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'. Error:(145, 21) No resource found that matches the given name: attr 'android:colorControlNormal'. Error:(142, 21) No resource found that matches the given name: attr 'android:colorPrimary'. Error:(143, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'. Error:(144, 21) No resource found that matches the given name: attr 'android:colorAccent'. Error:(146, 21) No resource found that matches the given name: attr 'android:colorControlActivated'. Error:(147, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'. Error:(145, 21) No resource found that matches the given name: attr 'android:colorControlNormal'. Error:(142, 21) No resource found that matches the given name: attr 'android:colorPrimary'. Error:(143, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'. Error:(144, 21) No resource found that matches the given name: attr 'android:colorAccent'. Error:(146, 21) No resource found that matches the given name: attr 'android:colorControlActivated'. Error:(147, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'. Error:(145, 21) No resource found that matches the given name: attr 'android:colorControlNormal'. Error:(142, 21) No resource found that matches the given name: attr 'android:colorPrimary'. Error:(143, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'. Error:(144, 21) No resource found that matches the given name: attr 'android:colorAccent'. Error:(146, 21) No resource found that matches the given name: attr 'android:colorControlActivated'. Error:(147, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'. Error:(145, 21) No resource found that matches the given name: attr 'android:colorControlNormal'. Error:(142, 21) No resource found that matches the given name: attr 'android:colorPrimary'. Error:(143, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'.
所有这些似乎都显示在:
\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0\res\values-v11\values.xml
和
\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0\res\values-v21\values.xml
AppCompat v21构build了需要API 21(Android 5.0)中提供的新API的主题。 要使用AppCompat编译您的应用程序,您还必须针对API 21进行编译。使用API 21编译/构build的推荐设置是compileSdkVersion
为21
, buildToolsVersion
为21.0.1
(这是目前最高的 – 您总是希望使用最新的构build工具)。
确保项目文件夹和appcompat_v7文件夹的project.properties文件中的target (它告诉目标android版本)的值是相同的(最好是最新的)。
:在'your_project'/ project.properties里面
target= android-21 android.library.reference.1=../appcompat_v7
和
:在appcompat_v7 / project.properties中
target= android-21 android.library=true
在此之后不要忘记清理你的项目。
在gradle.build中将compile 'com.android.support:appcompat-v7:21.0.0'
改为compile 'com.android.support:appcompat-v7:20.0.0'
。
如果您正在使用android studio转到文件 – >项目结构在属性选项卡更改编译Sdk版本到AP1 21和生成工具版本到最高可用版本。 然后刷新Gradle
改变complie SDK版本到API级别21为我固定它。 那么我遇到了其他应用程序部署到我的设备的问题。 我改变了最低限度API的水平,以我想要的,并解决它的目标。
因为有人正在经历这个。
只需select目标api级别为21进行编译,单击应用 – >单击确定 , 清理并生成项目并运行它。
我的solucion是与其他版本编译
build.gradle(app)
compileSdkVersion 21
祝你好运
改变你的编译SDK到23,这个修复了我。
我投谁谁可以像我一样解决。 我和你有同样的问题,我花了很多时间才得到正确的答案。 请testing。
升级整个SDK,更新21.0.2版本也有来自Google服务播放的更新。 升级一切。 在你的工作区删除文件夹(android -support-v7-AppCompat)和(google-play-services_lib)
将这些项目重新导入到IDE中,然后select将它们再次复制到工作区。
该项目(谷歌 – 播放 – services_lib)执行刷新和构build的行动
**** *****问题项目(android -support-v7-AppCompat)标记5.0 API然后刷新和生成。
在他的项目中,在属性,android,导入库(android -support-v7-AppCompat)和(google-play-services_lib),然后刷新和构build。
如果您不想使用API 21,则可以使用较旧版本的appcompact库,使用较旧的应用程序压缩库而不更新它。
你可以通过简单的步骤来达到这个目的:
1)提取完整的sdk和eclipse包的下载版本。
2)只需从sdk\extras\android\support\v7\appcompact
导入appCompact库
现在你完成了。
从这里引用:
要解决此问题,
- 右键单击
appcompat_v7
库并select属性- 现在,点击Android Option,
- 将项目构buildpath设置为Android 5.0(API级别21)
- 应用更改。
- 现在转到
appcompat_v7
库下的project.properties
文件,- 将项目目标设置为:
target=android-21
- 现在清理+构buildappcompat_v7库和您的项目
我已经更新了build.gradle(模块:应用程序):旧代码:
compile 'com.android.support:appcompat-v7:23.0.1'
新代码:
compile 'com.android.support:appcompat-v7:22.2.0'
在android工作室为我工作。
Resource for android
将是一个选项,当你去你的sdk manager
并selectAndroid 5.0
。 下载并安装。 这将解决资源未find的问题。
您好,我有涉及到appcompatv7
库相同的错误,我做@ianhanniballakebuild议,并检查库的构build版本,通过select它,并点击鼠标的次button,然后:
属性 – > Android – > Android 5.0.1 api level 21
然后清理所有的项目,但我没有运气,所以在失去了我所有的希望之后,我决定从Eclipse Kepler升级到Eclipse Luna。
当我正在等待下载完成。 我决定尝试另一件事情,所以我去了从eclipse appcompatv7
库中删除,并检查
删除磁盘上的项目内容。
打开Android SDK检查是否有任何更新,然后通过select我的项目并在我的项目中删除了我的项目中的所有库引用
项目 – >属性 – > Android – >库部分
删除了所有库,包括启动所有这些问题的库
Google_Play_Services_Lib
然后重新启动Eclipse并从Android SDK复制。文件夹appcompat来自:
Android的SDK-LINUX /演员/安卓/支持/ V7
到我的eclpse工作空间,然后将其导入到Eclipse中,然后从工作空间中导入exsting项目,然后select合适的构build工具版本
Android 5.0.1 api 21
并添加了我所有的参考库,清理了所有项目,并完成了所有工作。
我为我所有的参考库select了相同的构build工具。
希望这可以帮助!!!!
顺便说一句,我试图投票,但我没有足够的代表做这件事。
检查添加谷歌播放服务在这里,因为我面临同样的问题,并删除了一切,然后按照步骤,并得到了一切工作。
我遇到了同样的问题,并在我的build.gradle compileSdkVersion 21,targetSdkVersion 21和buildToolsVersion 21.0.1
但是,我在我的项目中包含了这个模块,所以我必须确保其他模块gradle设置符合API 21.之后,这一切都为我工作。
我变了
compile 'com.android.support:appcompat-v7:19.1.+'
成
compile 'com.android.support:appcompat-v7:22.1.+'
在build.gradle和同步后,我没有得到任何错误
在我使用Eclipse IDE的情况下,我遇到了同样的问题,解决scheme是:
1-安装最新的可用API(SDK平台和Google API)
2-使用以下设置创build项目:
- 编译:使用当时可用的最新API版本
- 其他值可以根据您的要求接收值(查看之前的评论中的每个值)
对我来说这是:
android { compileSdkVersion 21 buildToolsVersion '23.0' defaultConfig { applicationId "nl.changer.polypickerdemo" minSdkVersion 15 targetSdkVersion 21 --------- dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' }
我修改:compileSdkVersion 21 buildToolsVersion '23 .0'appcompat-v7:22.2.0'
当我导入google-services.json文件来实现分析时,我正面临着这个问题。 我已经在xml文件夹中有了global_tracker.xml文件。 在构build期间,在合并来自google-services.json文件的内容时,错误已经开始发生。 暂时,在删除goolgle-services.json文件后,错误得到解决。 并使用旧的分析解决scheme。
检查你编辑/导入的最后一个XML或Json文件,也许你会在那里发生错误。 这就是我的情况。
这帮助了我
- 将Android SDK更新到最新版本
-
用最新的组件更新
app/build.gradle
:compileSdkVersion 25 buildToolsVersion "25.0.2" minSdkVersion 17 targetSdkVersion 25
希望这可以解决你的问题
这对我来说很好。 转到android-support-v7-appcompat项目并打开文件“project.properties”,并在缺less的情况下插入以下行:
target=android-25 compile=android-21