android - 添加依赖项会导致 Android Studio 无法解析符号 'R' 错误

标签 android android-studio r.java-file

由于某种原因添加下面的这些依赖项会影响 R 类

  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:21.0.0'
  compile 'com.google.android.gms:play-services:6.+'

这是 list 文件

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.example.kiwi.clamprice" >
    <uses-sdk android:minSdkVersion="17"
      android:targetSdkVersion="19"
    />
  <uses-permission android:name="android.permission.INTERNET"/>


 <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name=".MyActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

这是activity_my.xml 文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.clamcoinPriceChecker.MainActivity"
android:background="@drawable/gradient"
 >

 <EditText
     android:id="@+id/donate"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_centerHorizontal="true"
     android:layout_centerVertical="true"
     android:ems="10" >
 </EditText>

 <Button
     android:id="@+id/update"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_below="@+id/donate"
     android:layout_centerHorizontal="true"
     android:layout_marginTop="36dp"
     android:text="Update" />

 <TextView
     android:id="@+id/title"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_above="@+id/donate"
     android:layout_centerHorizontal="true"
     android:text="Loading..."
     android:textSize="40sp"
     android:textColor="#ffffff"
     android:textStyle="bold"
     android:textAppearance="?android:attr/textAppearanceLarge" />

 <TextView
     android:id="@+id/textview2"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_above="@+id/title"
     android:layout_centerHorizontal="true"
     android:text="Price of Clam"
     android:textAppearance="?android:attr/textAppearanceMedium"
     android:textColor="#ffffff" />

 <com.google.android.gms.ads.AdView
     xmlns:ads="http://schemas.android.com/apk/lib-auto"
     android:id="@+id/adView"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_alignParentBottom="true"
     android:layout_centerHorizontal="true"
     ads:adSize="BANNER"
     ads:adUnitId="ca-app-pub-6521186892035757/5231806827" />


   </RelativeLayout>

我尝试了很多方法来尝试解决这个问题,我尝试重新启动 android studio,重建和清理项目,但都不起作用。

信息:编译在 12 秒内完成,有 68 个错误和 0 个警告 信息:68 个错误 信息:0 条警告 错误:Gradle:任务“:app:processDebugResources”执行失败。

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\MYSTUFF\AppData\Local\Android\android-studio\sdk\build-tools\android-4.4W\aapt.exe package -f --no-crunch -I C:\Users\MYSTUFF\AppData\Local\Android\android-studio\sdk\platforms\android-20\android.jar -M C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\manifests\debug\AndroidManifest.xml -S C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug -A C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\assets\debug -m -J C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\generated\source\r\debug -F C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\libs\app-debug.ap_ --debug-mode --custom-package com.example.kiwi.clamprice -0 apk --output-text-symbols C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\symbols\debug Error Code: 1 Output: C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:273: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:275: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:285: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:287: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:289: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:291: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:293: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:295: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:297: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:301: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:304: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:306: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:308: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:310: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:314: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:317: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:319: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:321: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:323: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:329: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:331: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:336: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Dialog'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:341: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:346: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.Dialog'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:147: error: Error: No resource found that matches the given name: attr 'android:colorAccent'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:149: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:150: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:148: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:145: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:146: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:185: error: Error: No resource found that matches the given name: attr 'android:colorAccent'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:187: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:188: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:186: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:183: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:184: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:223: error: Error: No resource found that matches the given name: attr 'android:colorAccent'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:225: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:226: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:224: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:221: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:222: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:261: error: Error: No resource found that matches the given name: attr 'android:colorAccent'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:263: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:264: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:262: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\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\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\res\debug\values-v21\values.xml:260: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. C:\Users\MYSTUFF\WorkspaceAndroidStudio\ClamPrice2\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0\res\values-v21\values.xml Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'. Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'. Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'. Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'. Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'. Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'. Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'. Error:Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.

最佳答案

打开 Android SDK 管理器并确保您拥有最新版本:

Android SDK 工具
Android SDK 构建工具
SDK平台

打开项目属性并确保项目构建目标设置为使用最新平台 (5.0)。

关于android - 添加依赖项会导致 Android Studio 无法解析符号 'R' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27695629/

相关文章:

android - 恢复 R.java 文件

项目新 session 的 Java 临时文件

java - 无法使用 baseadapter 解析带有 listview 的构造函数适配器

android - Android模拟器的第一次使用

json - org.json.JSONException : No value for name

android - Android Studio 中的 "cannot resolve symbol R"

java - TabLayout 不可用,错误膨胀,导入的所有内容但不是 "visible"

android - TextView 和 EditText 在 LinearLayout 中被截断

Android 用 xml 中的另一个线性布局替换线性布局

java - 将“设置” Activity 连接到“Activity 2”后,我的应用程序崩溃了