question

Kris B avatar image
Kris B asked

No resource identifier found for attribute 'adSize'

Getting this error when trying to implement an ad via XML: No resource identifier found for attribute 'adSize' in package 'com.my.app':
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kris B avatar image
Kris B answered
Just a follow-up. I've added the attrs.xml file to the res/values folder. One thing with my project, is that I am trying to integrate the ads in into a library project. The way my apps are setup, I have most of the code in a library project and I'm not sure if it's causing this issue. I've tried everything and I can't get it to find the 'adSize' attribute.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kris B avatar image
Kris B answered
I figured out the issue. If you're using a library project you have to use "lib" not "res" in the namespace, eg: http://schemas.android.com/apk/lib/com.my.app Thanks for the heads-up Amazon. Now I'm getting a new error: java.lang.IllegalArgumentException: Invalid ad size string. See documentation for available ad sizes even though I'm specifying a string of "320x50", which seems to be a valid size. Hey Amazon, could you have made it any harder to implement your ads?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kris B avatar image
Kris B answered
Ok, finally figure it out. You have to use: " http://schemas.android.com/apk/res-auto" for the namespace
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sachin@Amazon avatar image
Sachin@Amazon answered
Hi Kris, Its good to know that you have solved your issue. This would surely help other developers as well. Thank you.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.