Android Studio出现问题!无法解析符号R,找不到与给定名称匹配的资源

朱利安·加西亚(Julian Garcia)

我在使用Android Studio时遇到了大问题。我最近与我的朋友一起开发了一个项目,当我打开它时,项目中的所有R都变成红色(“无法解析符号R”)。

我搜索了此问题的答案,并尝试了几乎所有方法...同步Gradle,等级清洁等...哦,当我使用Build-> Clean Project时,它返回118错误。完整)控制台输出:

 Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:app:preBuild
:app:compileDebugNdk
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72100Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42100Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:9: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:11: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:13: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:15: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:17: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:21: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:23: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:27: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:35: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:39: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:43: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:45: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:47: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:49: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:51: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:59: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:63: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:67: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:69: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:71: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:73: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:77: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v11\values.xml:39: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v14\values.xml:12: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v11\values.xml:46: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v14\values.xml:20: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v11\values.xml:53: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v14\values.xml:28: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v11\values.xml:60: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v14\values.xml:36: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:87: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:89: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.ActionBar'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Dark'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:100: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Dark.ActionBar'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:108: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Light'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:267: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:269: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:271: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:273: error: Error retrieving parent for item: No resource found that matches the given 
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:259: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug\values-v21\values.xml:260: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    C:\Users\Juliano\Downloads\Compressed\adt-bundle-windows-x86_64-20140321\adt-bundle-windows-x86_64-20140321\sdk\build-tools\20.0.0\aapt.exe package -f --no-crunch -I C:\Users\Juliano\Downloads\Compressed\adt-bundle-windows-x86_64-20140321\adt-bundle-windows-x86_64-20140321\sdk\platforms\android-14\android.jar -M C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\manifests\debug\AndroidManifest.xml -S C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\res\debug -A C:\Users\Juliano\Documents\Projects\HueLoc\app\build\intermediates\assets\debug -m -J C:\Users\Juliano\Documents\Projects\HueLoc\app\build\generated\source\r\debug -F 

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.873 secs

是的,就是这样。.请有人帮助我!(我使用的是W7,Android Studio最新版本)

//更新:我通过删除“ value21”文件夹中的value.xml文件来修复它……显然Android Studio进行了更新,这迫使我使用Android L ...我更改了appcompat库的版本在我的项目的build.grade中(依赖项)到19(我使用的是21,因此我进行了降级)...

阿德里安·奇福(Adrian Chifor)

我过去一直都在获取“ R”错误。该修复程序包括以下步骤:-
检查build.gradle文件中是否存在错误或警告-
重新启动Android Studio-检查
稳定的版本更新-
打开SDK管理器,并确保已安装所有新软件包和更新
-(有时)重建了项目
-同步gradle

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Android Studio出现问题!无法解析符号R,找不到与给定名称匹配的资源

来自分类Dev

Android Studio-找不到与给定名称匹配的资源

来自分类Dev

找不到与给定名称匹配的资源:attr'android:actionModeShareDrawable'

来自分类Dev

找不到与给定名称匹配的资源:attr'android:windowTranslucentNavigation'

来自分类Dev

找不到与给定名称Xamarin Android匹配的资源

来自分类Dev

XML / Android:找不到与给定名称错误匹配的资源

来自分类Dev

找不到与给定名称匹配的资源:attr'android:elevation'

来自分类Dev

XML / Android:找不到与给定名称错误匹配的资源

来自分类Dev

找不到与给定名称匹配的资源:attr 'android:keyboardNavigationCluster'

来自分类Dev

找不到与给定名称匹配的资源:attr 'android:keyboardNavigationCluster'

来自分类Dev

“找不到与给定名称匹配的资源:attr 'android:keyboardNavigationCluster'”

来自分类Dev

错误找不到与给定名称匹配的资源:Android Studio中的attr'borderWidth'

来自分类Dev

找不到与给定名称“ Theme.AppCompat.Light”匹配的资源。Android Studio

来自分类Dev

在Android Studio中构建项目时出现错误“错误:找不到与给定名称匹配的资源(在____处值为'@ drawable / <name>')

来自分类Dev

Eclipse Android插件问题“错误:找不到与给定名称匹配的资源(在“主题”处,值为“ @ style / AppTheme”)”

来自分类Dev

找不到与给定名称匹配的资源:即使我正在使用appcompat 20,也无法找到attr android:actionModeShareDrawable

来自分类Dev

Android:Urban Airship 6.0.1:android:elevation找不到与给定名称匹配的资源

来自分类Dev

找不到与给定名称“ android:Theme.Material.Light.DarkActionBar”匹配的资源

来自分类Dev

找不到与给定名称匹配的资源(在'cardBackgroundColor'处,值为'?android:attr / colorBackgroundFloating')

来自分类Dev

找不到与给定名称“ android:Theme.Material”匹配的资源

来自分类Dev

找不到与给定名称匹配的资源(位于“ android:color Primary”处)

来自分类Dev

找不到与给定名称“ android:Theme.Holo.Light.DarkActionBar”匹配的资源

来自分类Dev

编译错误:找不到与给定名称“ android:elevation”匹配的资源

来自分类Dev

[Android] [XML]错误:(19,31)找不到与给定名称匹配的资源。(layout_above)

来自分类Dev

找不到与给定名称匹配的资源(在'id'处,值为'@android:id / kish')

来自分类Dev

找不到与给定名称“android:TextAppearance.Material.Widget.Button.Borderless.Colored”匹配的资源

来自分类Dev

检索项目的父项时出错:找不到与给定名称 android 匹配的资源

来自分类Dev

Android Studio检索项目的父项时出错:找不到与给定名称'Theme.AppCompat.Light.DarkActionBar'匹配的资源

来自分类Dev

检索父项时出错:找不到与给定名称'android:Theme.Material.Light'相匹配的资源

Related 相关文章

  1. 1

    Android Studio出现问题!无法解析符号R,找不到与给定名称匹配的资源

  2. 2

    Android Studio-找不到与给定名称匹配的资源

  3. 3

    找不到与给定名称匹配的资源:attr'android:actionModeShareDrawable'

  4. 4

    找不到与给定名称匹配的资源:attr'android:windowTranslucentNavigation'

  5. 5

    找不到与给定名称Xamarin Android匹配的资源

  6. 6

    XML / Android:找不到与给定名称错误匹配的资源

  7. 7

    找不到与给定名称匹配的资源:attr'android:elevation'

  8. 8

    XML / Android:找不到与给定名称错误匹配的资源

  9. 9

    找不到与给定名称匹配的资源:attr 'android:keyboardNavigationCluster'

  10. 10

    找不到与给定名称匹配的资源:attr 'android:keyboardNavigationCluster'

  11. 11

    “找不到与给定名称匹配的资源:attr 'android:keyboardNavigationCluster'”

  12. 12

    错误找不到与给定名称匹配的资源:Android Studio中的attr'borderWidth'

  13. 13

    找不到与给定名称“ Theme.AppCompat.Light”匹配的资源。Android Studio

  14. 14

    在Android Studio中构建项目时出现错误“错误:找不到与给定名称匹配的资源(在____处值为'@ drawable / <name>')

  15. 15

    Eclipse Android插件问题“错误:找不到与给定名称匹配的资源(在“主题”处,值为“ @ style / AppTheme”)”

  16. 16

    找不到与给定名称匹配的资源:即使我正在使用appcompat 20,也无法找到attr android:actionModeShareDrawable

  17. 17

    Android:Urban Airship 6.0.1:android:elevation找不到与给定名称匹配的资源

  18. 18

    找不到与给定名称“ android:Theme.Material.Light.DarkActionBar”匹配的资源

  19. 19

    找不到与给定名称匹配的资源(在'cardBackgroundColor'处,值为'?android:attr / colorBackgroundFloating')

  20. 20

    找不到与给定名称“ android:Theme.Material”匹配的资源

  21. 21

    找不到与给定名称匹配的资源(位于“ android:color Primary”处)

  22. 22

    找不到与给定名称“ android:Theme.Holo.Light.DarkActionBar”匹配的资源

  23. 23

    编译错误:找不到与给定名称“ android:elevation”匹配的资源

  24. 24

    [Android] [XML]错误:(19,31)找不到与给定名称匹配的资源。(layout_above)

  25. 25

    找不到与给定名称匹配的资源(在'id'处,值为'@android:id / kish')

  26. 26

    找不到与给定名称“android:TextAppearance.Material.Widget.Button.Borderless.Colored”匹配的资源

  27. 27

    检索项目的父项时出错:找不到与给定名称 android 匹配的资源

  28. 28

    Android Studio检索项目的父项时出错:找不到与给定名称'Theme.AppCompat.Light.DarkActionBar'匹配的资源

  29. 29

    检索父项时出错:找不到与给定名称'android:Theme.Material.Light'相匹配的资源

热门标签

归档