2016-07-22 197 views
0

我正在爲已經開發的android應用程序(內置於Eclipse)中添加一項新功能。該功能是獲得使用Android設計庫和支持庫錯誤,同時包括'com.google.android.gms:play-services:8.4.0

com.google.android.gms:play-services:8.4.0 

這裏是我的build.gradel谷歌緯度和經度,

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 16 
buildToolsVersion "24.0.1" 

defaultConfig { 
    applicationId "com.myproject.activities" 
    minSdkVersion 14 
    targetSdkVersion 18 
} 

buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
    } 
    } 
} 

dependencies { 
compile 'com.android.support:support-v4:18.0.0' 
compile 'com.google.code.gson:gson:2.2.4' 
compile files('libs/google-play-services.jar') 

}

當我刪除compile files('libs/google-play-services.jar'),並添加compile 'com.google.android.gms:play-services:8.4.0'我得到建立自己的錯誤

Error:(6, 21) No resource found that matches the given name: attr 'android:textAlignment'. 

這裏是我的完整版本錯誤:

C:\Users\maven\AndroidStudioProjects\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-appinvite\8.4.0\res\values-v21\appinvite_styles.xml 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'. 
 
C:\Users\maven\AndroidStudioProjects\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0\res\values-v17\values-v17.xml 
 
Error:(6, 21) No resource found that matches the given name: attr 'android:textAlignment'. 
 
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'. 
 
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'. 
 
Error:(13, 21) No resource found that matches the given name: attr 'android:paddingStart'. 
 
Error:(17, 21) No resource found that matches the given name: attr 'android:layout_marginEnd'. 
 
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'. 
 
Error:(23, 21) No resource found that matches the given name: attr 'android:layout_marginStart'. 
 
Error:(26, 21) No resource found that matches the given name: attr 'android:layout_alignParentStart'. 
 
Error:(6, 21) No resource found that matches the given name: attr 'android:textAlignment'. 
 
Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'. 
 
Error:(13, 21) No resource found that matches the given name: attr 'android:paddingStart'. 
 
Error:(26, 21) No resource found that matches the given name: attr 'android:layout_alignParentStart'. 
 
Error:(37, 21) No resource found that matches the given name: attr 'android:layout_toStartOf'. 
 
Error:(40, 21) No resource found that matches the given name: attr 'android:layout_alignParentEnd'. 
 
Error:(44, 21) No resource found that matches the given name: attr 'android:layout_toEndOf'. 
 
Error:(37, 21) No resource found that matches the given name: attr 'android:layout_toStartOf'. 
 
Error:(23, 21) No resource found that matches the given name: attr 'android:layout_marginStart'. 
 
C:\Users\maven\AndroidStudioProjects\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0\res\values-v21\values-v21.xml 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.EditText'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Title'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.TextView.SpinnerItem'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'. 
 
Error:(124, 21) No resource found that matches the given name: attr 'android:colorAccent'. 
 
Error:(128, 21) No resource found that matches the given name: attr 'android:colorButtonNormal'. 
 
Error:(126, 21) No resource found that matches the given name: attr 'android:colorControlActivated'. 
 
Error:(127, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'. 
 
Error:(125, 21) No resource found that matches the given name: attr 'android:colorControlNormal'. 
 
Error:(122, 21) No resource found that matches the given name: attr 'android:colorPrimary'. 
 
Error:(123, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'. 
 
Error:(131, 21) No resource found that matches the given name: attr 'android:windowElevation'. 
 
Error:(124, 21) No resource found that matches the given name: attr 'android:colorAccent'. 
 
Error:(128, 21) No resource found that matches the given name: attr 'android:colorButtonNormal'. 
 
Error:(126, 21) No resource found that matches the given name: attr 'android:colorControlActivated'. 
 
Error:(127, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'. 
 
Error:(125, 21) No resource found that matches the given name: attr 'android:colorControlNormal'. 
 
Error:(122, 21) No resource found that matches the given name: attr 'android:colorPrimary'. 
 
Error:(123, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'. 
 
Error:(131, 21) No resource found that matches the given name: attr 'android:windowElevation'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless.Colored'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Small'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ButtonBar'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.CheckBox'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.RadioButton'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'. 
 
Error:(217, 21) No resource found that matches the given name: attr 'android:overlapAnchor'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'. 
 
Error:(217, 21) No resource found that matches the given name: attr 'android:overlapAnchor'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.RatingBar'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.TextView.SpinnerItem'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'. 
 
Error:(124, 21) No resource found that matches the given name: attr 'android:colorAccent'. 
 
Error:(128, 21) No resource found that matches the given name: attr 'android:colorButtonNormal'. 
 
Error:(126, 21) No resource found that matches the given name: attr 'android:colorControlActivated'. 
 
Error:(127, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'. 
 
Error:(125, 21) No resource found that matches the given name: attr 'android:colorControlNormal'. 
 
Error:(122, 21) No resource found that matches the given name: attr 'android:colorPrimary'. 
 
Error:(123, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'. 
 
C:\Users\maven\AndroidStudioProjects\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0\res\values-v23\values-v23.xml 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. 
 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. 
 
Error:Execution failed for task ':app:processDebugResources'. 
 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\maven\AppData\Local\Android\sdk\build-tools\24.0.1\aapt.exe'' finished with non-zero exit value 1 
 
Information:BUILD FAILED 
 
Information:Total time: 6.737 secs 
 
Information:116 errors

我似乎沒有搞清楚爲什麼我收到此錯誤。

+0

com.google.android.gms:play-services:9.2.1是最新的 – Eenvincible

回答

1

首先要把你所有的工具最新版本:

然後用版本添加播放服務庫爲:

compile 'com.google.android.gms:play-services:9.2.1' 

然後

compile 'com.android.support:support-v4:24.0.1' 

,當你添加的庫從Gradle中播放服務,它會拋出multidex錯誤,因爲新的庫添加使得播放服務庫總計方法數超過了64K的限制。所以請按照以下步驟操作:link