0

When I add the code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#F0F8FF"
    android:orientation="vertical" >
<ListView
    android:id="@+id/lvHienThi"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
</ListView>

<com.google.android.gms.ads.AdView
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:id="@+id/adview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center"
    ads:adSize="BANNER"
    ads:adUnitId="@string/ad_unit_id" />

it show me :"No resource identifier found for attribute 'adSize' in package '....'" How can I fix it ? Please help me. Thank you !

tran minh
  • 1
  • 4

2 Answers2

1

Replace /res/ with /lib/ in your custom layout nampespace

 xmlns:android="http://schemas.android.com/apk/res/android" 

will be

 xmlns:yourApp="http://schemas.android.com/apk/lib/com.yourAppPackege.yourClass"

i hope it help :)

sasikumar
  • 12,540
  • 3
  • 28
  • 48
1

instead of

xmlns:ads="http://schemas.android.com/apk/res-auto"

add

xmlns:ads="http://schemas.android.com/apk/res/your.package.name"

replacing "your.package.name" with your actual package name

Kenny C
  • 2,279
  • 1
  • 19
  • 20
  • Hi , I tried it . And I see a new problem : http://s1277.photobucket.com/user/minkun9x/media/Untitled_zps18m4rosq.jpg.html Please help me . Thank you ! – tran minh Jun 23 '15 at 15:43