2014-12-29 55 views
1

下面的添加由於某種原因影響R類添加依賴給人着解析符號 'R' 的錯誤的Android工作室

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

這是清單文件

<?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> 

這這些dependecines是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,重建和清理項目,並沒有任何工作。

信息:編譯與68個錯誤和0個警告完成了12秒 信息:68個錯誤 信息:0警告 錯誤:搖籃:執行失敗的任務 ':應用程序: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'.

回答

0

大部分時間錯誤消息「無法解析符號‘R’」的發生是由於損壞的XML文件,無論是AndroidManifest.xml文件,佈局文件或值文件;檢查所有的XML文件並確保它們中沒有錯誤。還請確保您沒有重複的資源目錄或無效的Drawable名稱。確保在檢查完所有的清理工作並重新構建項目之後,只需採取措施即可。

如果您發現沒有問題,仍然無法成功編譯,您可以嘗試保存並重新導入項目。創建一個新的Workspace也可以解決某些問題。

編輯

另外,我沒有看到結束標記爲您AndroidManifest.xml文件 - 你應該在你的文件的末尾有</manifest>

最後,您是否確保您在應用程序/模塊build.gradle文件中添加了依賴關係,而不是頂級build.gradle文件?

EDIT 2

確保所有的資源和文件夾的是小寫的;在資源名稱或目錄中使用任何大寫字母可能會導致問題,並且診斷將會非常棘手。

另外,你有沒有嘗試手動刷新你的依賴關係?您可以通過使用命令行選項:--refresh-dependencies和/或通過手動刪除依賴關係緩存~/.gradle/caches來完成此操作。使用項目clean/rebuild執行依賴項刷新。

我還看到您計劃在應用程序中使用Google Play服務,如依賴項導入所示。您是否確保通過SDK管理器下載了「Google Play服務」和「Google Repository」?沒有「Google Repository」,「Google Play服務」將無法使用。

最後要做的一件事就是調出build.gradle文件中com.google.android.gms:play-services的特定版本;看到這個線程:After update - Error:Failed to find: com.google.android.gms:play-services:5.2.8。請檢查以確保您遵循了將Google Play服務集成到您的應用程序中的所有適當步驟,如Android開發人員文檔中所述:http://developer.android.com/google/play-services/setup.html

還要確保在對依賴項進行任何更改之後,將更新的gradle文件與項目同步。

+0

對不起,我沒有複製整個清單文件,是唯一被切斷的部分,我在應用程序build.gradle文件中添加了依賴項,生病做什麼你在頂部說,看看它是否有效。 – kiwicode

+0

我嘗試了你的建議,但它沒有工作,所以我發佈了上面的錯誤日誌的一部分,因爲我不適合所有。 – kiwicode

1

打開Android SDK管理器,並確保您有最新:

Android SDK工具
的Android SDK構建工具
SDK平臺

打開你的項目屬性,並確保項目建設目標設爲使用最新的平臺(5.0)。

+0

duplicate -

1

在Android Studio中:
文件 - >項目結構 - >屬性選項卡 - >確保您的「編譯SDK版本」設置爲API 21

支持V7資源將僅裝你至少要編譯API 21.

相關問題