尝试将 admob 合并到我的 Android 应用程序中时出错
我正在尝试将 admob 添加到我的应用程序中,但我运气不佳。
我按照教程中的示例并使用 XML 方法来创建横幅。除了 1 部分之外,一切似乎都工作正常并且编译没有错误...(当我尝试在清单中声明活动时。)
这是我正在尝试的条目:
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
这是我收到的错误:
错误:错误:不允许使用字符串类型(在“configChanges”处,值为 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize')。
除此之外,如果我尝试使用清单中存在的此条目进行清理和构建,R.file 就会消失并且不会回来。我很困惑。我还不是很了解,但我想知道这个错误是否与过时的语法有关。该条目是逐字复制的,但 eclipse 似乎说它不知道如何阅读?想法?
I'm trying to add admob into my app but i'm not having much luck.
I'm following the examples in the tutorial and using the XML method to create the banner. Everything seems to work fine and compile without error except for 1 part... (when I try to declare the activity in the manifest.)
Here is the entry i'm attempting:
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
and here is the error i'm getting:
error: Error: String types not allowed (at 'configChanges' with value
'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').
In addition to this, if I attempt a clean and build with this entry present in the manifest, the R.file disappears and won't come back. I'm puzzled. I'm not very knowledgeable yet but i'm wondering if this error has something to do with an outdated syntax. The entry is copied word for word, but eclipse seems to be saying it doesn't know how to read it? Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最新的 AdMob jar 需要针对 13 SDK 进行构建。我将其添加到清单中,
您会在清单中收到一条警告,指出 minSdkVersion 小于 targetSdkVersion,但我还没有看到这会导致任何问题。
您还需要将default.properties或project.properties中的行更改为
希望这会有所帮助。
The newest AdMob jar requires being build against the 13 SDK. I added this to the manifest
You'll get a warning in the manifest that the minSdkVersion is less than the targetSdkVersion, but I haven't seen that cause any issues.
You also need to change the line in default.properties or project.properties to
Hope this helps.