错误:在包“com.google.example"main.xml 中找不到属性“adSize"的资源标识符 [英] error: No resource identifier found for attribute 'adSize' in package 'com.google.example' main.xml

查看:19
本文介绍了错误:在包“com.google.example"main.xml 中找不到属性“adSize"的资源标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我按照说明通过 xml 将广告添加到我的应用程序时,我收到以下错误:

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

我确实编辑了 main.xml,添加了 attrs.xml 文件,但编译器不喜欢它.

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

推荐答案

将自定义布局命名空间中的 /res/ 替换为 /lib/.

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

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

在你的情况下,将是:

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

希望对你有帮助.

这篇关于错误:在包“com.google.example"main.xml 中找不到属性“adSize"的资源标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆