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

user584819 picture user584819 · Apr 28, 2011 · Viewed 228.4k times · Source

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.

Answer

M_AWADI picture M_AWADI · Jan 13, 2013

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

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

in your case, would be:

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

I hope it helps.