没有得到发现在包属性“adSize时”资源标识符加法编译之后“com.google.android.gms:发挥服务:3.1 +。”
我得到没有得到发现在包属性“adSize时”资源标识符加法编译之后“com.google.android.gms:发挥服务:3.1 +。”
未发现资源标识符属性 'adSize时' 中包
和
否在包发现属性 'adUnitId设置' 资源标识符
错误,因为我更新build.gradle文件。
的build.gradle
apply plugin: 'com.android.application' android { 
    compileSdkVersion 21 
    buildToolsVersion "21.1.2" 
    defaultConfig { 
     applicationId "com.example.admobdemo" 
     minSdkVersion 11 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 
dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:22.0.0' 
    compile "com.google.android.gms:play-services:3.1.+" 
    compile project(path: ':backend', configuration: 'android-endpoints') 
} 
如果我更换
compile "com.google.android.gms:play-services:3.1.+" 与
compile 'com.google.android.gms:play-services:7.0.0' 它work.but我自己也是在执行应用程序GCM推送通知。根据google docs我必须添加谷歌播放服务:3.1。+。
My_Activity.xml
<android.support.v4.widget.DrawerLayout xmlns:ads="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/drawer_layout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" > 
<!-- The main content view --> 
<LinearLayout 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="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_margin="0dp" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    android:background="@color/dark_brown" 
    android:orientation="vertical" 
    tools:context=".GeneralInstructionsActivity" > 
    <WebView 
     android:id="@+id/webView1" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="2" 
     /> 
    <Button 
     android:id="@+id/otherAppsBtn" 
     style="@style/ButtonStyle" 
     android:visibility="gone" 
     android:layout_width="wrap_content" 
     android:layout_height="40dp" 
     android:padding="3dp" 
     android:layout_gravity="center" 
     android:layout_margin="3dp" 
     android:gravity="center" 
     android:onClick="showOtherApps" 
     android:text="@string/otherApps" 
     android:textSize="17sp" 
     android:typeface="serif" /> 
    <!-- <com.google.android.gms.ads.AdView 
     android:id="@+id/about_adView" 
     android:background="@android:color/background_dark" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     ads:adUnitId="@string/ad_unit_id" 
     ads:adSize="SMART_BANNER" 
     />--> 
    <com.google.android.gms.ads.AdView 
     android:id="@+id/about_adView1" 
     android:layout_width="match_parent" 
     android:layout_height="50dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     ads:adSize="SMART_BANNER" 
     ads:adUnitId="@string/ad_unit_id" > 
    </com.google.android.gms.ads.AdView> 
</LinearLayout> 
<!-- The navigation drawer --> 
<LinearLayout 
    android:id="@+id/drawer" 
    android:layout_width="240dp" 
    android:layout_height="match_parent" 
    android:layout_gravity="start" 
    android:background="#f4f4f4" 
    android:orientation="vertical" > 
    <ExpandableListView 
     android:id="@+id/drawer_list1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/dark_brown" 
     android:cacheColorHint="#00000000" 
     android:divider="#666666" 
     android:dividerHeight="2dp" 
     android:groupIndicator="@android:color/transparent" /> 
</LinearLayout> 
任何帮助将不胜感激!
谢谢。
回答:
我想你会发现Admob是Google play Services 3.1的一部分。尝试更新的版本。
它绝对是GPS的一部分6.5
以上是 没有得到发现在包属性“adSize时”资源标识符加法编译之后“com.google.android.gms:发挥服务:3.1 +。” 的全部内容, 来源链接: utcz.com/qa/259231.html








