dimanche 19 avril 2015

Getting No resource identifier found for attribute 'adSize' in package right after adding compile "com.google.android.gms:play-services:3.1.+"

I am getting



No resource identifier found for attribute 'adSize' in package



and



No resource identifier found for attribute 'adUnitId' in package



error since I updated build.gradle file.


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')
}


If I replace



compile "com.google.android.gms:play-services:3.1.+"


with



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


It work.But I am also implementing GCM Push notification in app. According to google docs I have to add google-play-service:3.1.+.


My_Activity.xml



<android.support.v4.widget.DrawerLayout xmlns:ads="http://ift.tt/GEGVYd"
xmlns:android="http://ift.tt/nIICcg"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<!-- The main content view -->

<LinearLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
xmlns:ads="http://ift.tt/GEGVYd"
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>


Any help will be appreciated!


Thanks.


Aucun commentaire:

Enregistrer un commentaire