Alex Rivera | Logout

error: No resource identifier found for attribute 'adSize' in package 'com.google.example' main.xml

Asked 2011-04-28T13:27:39.743
146

When I followed the instructions to add an ad into my app by xml, I got the following errors:

Description Resource Path Location Type
error: No resource identifier found for attribute 'adSize' in package 'com.google.example'  main.xml    /HelloWorld/res/layout  line 12 Android AAPT Problem
Description Resource Path Location Type
error: No resource identifier found for attribute 'adUnitId' in package 'com.google.example'    main.xml    /HelloWorld/res/layout  line 12 Android AAPT Problem

I did edit the main.xml, add attrs.xml file but the compiler didn't like it.

Edit
Report

1 Answer

3

As you specify in your attrs.xml your adSize attribute belongs to the namespace com.google.ads.AdView. Try to change:

android:adUnitId="a14bd6d2c63e055"         android:adSize="BANNER"

to

ads:adUnitId="a14bd6d2c63e055"         ads:adSize="BANNER"

and it should work.

answered 2011-11-11T08:09:41.653

Your Answer