error: No resource identifier found for attribute #39;adSize#39; in package #39;com.google.example#39;main.xml(错误:在包“com.google.examplemain.xml 中找不到属性“adSize的资源标识符)
本文介绍了错误:在包“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"的资源标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
织梦狗教程
本文标题为:错误:在包“com.google.example"main.xml 中找不到属性“adSize"的资源标识符


基础教程推荐
猜你喜欢
- NSString intValue 不能用于检索电话号码 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01