Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android AppCompat v7 r21在values.xml中返回错误?_Android_Android Studio_Android Appcompat - Fatal编程技术网

Android AppCompat v7 r21在values.xml中返回错误?

Android AppCompat v7 r21在values.xml中返回错误?,android,android-studio,android-appcompat,Android,Android Studio,Android Appcompat,我正在使用Android Studio,当我添加编译“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 Erro

我正在使用Android Studio,当我添加
编译“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


AppCompat v21构建的主题需要API 21(Android 5.0)中提供的新API。要使用AppCompat编译应用程序,还必须根据API 21进行编译。使用API 21编译/生成的建议设置是
compileSdkVersion
21
21.0.1的
buildToolsVersion
(此时最高-您始终希望使用最新的生成工具)当您转到
sdk管理器
并选择
android 5.0
时,android的
资源将是一个可用的选项。下载并安装。这将解决找不到资源的问题。

如果您使用的是android studio goto 文件-->项目结构 在属性选项卡中,更改将Sdk版本编译为AP1 21,并将生成工具版本编译为最高可用版本。
然后刷新Gradle

将Gradle.build中的
编译'com.android.support:appcompat-v7:21.0.0'
更改为
编译'com.android.support:appcompat-v7:20.0.0'
,我投票给像我一样能解决问题的人。 我和你有同样的问题,我花了很多时间来纠正。 请测试一下

升级整个SDK,更新21.0.2版本也有来自Google Services play的更新。 升级一切。 在您的工作区中删除文件夹(android-support-v7-AppCompat)和(google-play-services_-lib)

将这些项目重新导入IDE,然后选择将它们再次复制到您的工作区

执行刷新和构建操作的项目(google-play-services_lib)

***********问题 该项目(android-support-v7-AppCompat)标记5.0API,然后刷新和构建


在他的项目中,在properties,android中,导入库(android-support-v7-AppCompat)和(google-play-services_lib),然后刷新和构建。

确保target的值(它告诉目标android版本)在project.properties文件中,您的项目文件夹和appcompat_v7文件夹是相同的(最好是最新的)

:在'your_project'/project.properties内

target=android-21
android.library.reference.1=../appcompat_v7

:在appcompat_v7/project.properties中

target=android-21
android.library=true


在此之后,不要忘记清理项目。

如果不想使用API 21,可以使用旧版本的appcompact库,使用旧版本的appcompact库而不进行更新

您只需执行以下步骤即可实现此目的:

1) 解压缩完整sdk和eclipse捆绑包的下载版本

2) 只需从
sdk\extras\android\support\v7\appCompact


现在您完成了。

将complie SDk版本更改为API级别21为我修复了它。然后,我遇到了在我的设备上部署应用程序的其他问题。我将minimun API级别更改为我想要的目标,并将其修复


万一有人再次遇到这种情况。

您好,我遇到了与
appcompatv7
库相同的错误,我按照@ianhanniballake的建议进行了操作,通过选择库并用鼠标的辅助按钮单击,检查库的构建版本,然后:

属性->安卓->安卓5.0.1 api级别21

然后清理所有项目,但我没有运气,所以在失去所有希望后,我决定从EclipseKepler升级到EclipseLuna

在我等待下载完成的时候。我决定尝试另一种方法,所以我从eclipse中删除了
appcompatv7
库并检查了

删除磁盘上的项目内容

打开Android SDK以检查是否有任何更新,然后我通过选择我的项目并在下面删除项目中的所有库引用

项目->属性->Android->库部分

已删除所有库,包括引发此问题的库

谷歌游戏服务库

然后重新启动Eclipse并从Android SDK复制。文件夹appcompat来自:

android sdk linux/extras/android/support/v7

到我的eclpse工作区,然后将其从工作区中的Import exsting项目再次导入到Eclipse中,然后选择propper构建工具版本

Android 5.0.1 api 21

添加了我所有的参考库,清理了所有的项目,一切都恢复了正常

我为所有参考库选择相同的构建工具

希望这有帮助


顺便说一句,我试着投票,但我没有足够的代表来投票。

检查添加google play服务,因为我面临同样的问题,并删除了所有内容,然后按照步骤进行操作,使所有内容正常工作。

只需选择目标api级别为21进行编译,单击应用->单击确定清理构建项目并运行


我遇到了同样的问题,在我的build.gradle中有正确的API级别值编译SDK版本21、targetSdkVersion 21和buildToolsVersion 21.0.1


然而,我在我的项目中将它作为一个模块,所以我必须确保其他模块的gradle设置与API21相匹配。在那之后,一切都对我有效。

我的解决方案是用其他版本编译的

build.gradle(应用程序)


祝你好运

将你的编译sdk更改为23。这为我解决了问题。

我更改了

compile 'com.android.support:appcompat-v7:19.1.+'
进入

内建
compileSdkVersion 21
compile 'com.android.support:appcompat-v7:19.1.+'
compile 'com.android.support:appcompat-v7:22.1.+'
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'


}
  compile 'com.android.support:appcompat-v7:23.0.1'
 compile 'com.android.support:appcompat-v7:22.2.0'
compileSdkVersion 25  
buildToolsVersion "25.0.2"  
minSdkVersion 17  
targetSdkVersion 25