Android 横幅广告 SDK

发布于 2025-01-18 11:04:00 字数 459 浏览 3 评论 0原文

我在将横幅广告添加到我的Android应用程序中遇到了问题。我使用版本27 SDK完成了该应用程序。我遵循有关添加横幅广告的说明,当我添加“实现'com.google.android.gms:play-services-ads:20.6.0'” build.gradle中,Android Studio标记了SDK不足和不足的错误需要升级到31或更高。

我使用“项目结构对话框”将SDK升级到版本31,然后IDE突出显示了需要升级的依赖项,我使用“建议”选项卡来升级,试图运行代码并且不会运行。 如下所示。

终端 预先感谢您的时间。

多亏了@mikahli,我能够克服依赖性问题,但是我现在在初始化时遇到了错误。我在文档中复制了代码,请参阅初始化错误。事先感谢所有参与其中的人。

I am having problems adding Banner Ads to my Android App. I had done the app using Version 27 SDK. I followed the instruction on adding Banner ads, when I added the "implementation 'com.google.android.gms:play-services-ads:20.6.0'" in build.gradle, Android Studio flagged an error that SDK is inadequate and needs to be upgraded to 31 or higher.

I used the Project Structure Dialog to upgrade the SDK to version 31, the IDE then highlighted the dependencies that needed upgrading which I used the "Suggestion" tab to upgrade, tried to run the code and it won't run.The error on build terminal is shown below Build terminal error

Please can anyone help me solve this problem? Thanks in advance for your time.

Thanks to @Mikahli, I was able to go past the dependency issue but I am now getting errors on initialisation. I copied the code in the documentation, please see Initialisation Errors. Thanks in advance to everyone involved.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清欢 2025-01-25 11:04:00

请检查以下 link
也许这是您现在面临的问题:

如果您的应用程序针对Android 12或更高,并且包含活动,则
服务或使用意图过滤器的广播接收器,您必须
明确声明这些应用程序的Android:导出属性
组件。

如果是这种情况

<activity android:name=".MainActivity"
            android:exported="true"
            >

please check the following link.
Maybe this is the problem you are facing now:

If your app targets Android 12 or higher and contains activities,
services, or broadcast receivers that use intent filters, you must
explicitly declare the android:exported attribute for these app
components.

If that's the case you can fix it by adding android:exported="true" to activities, services, or broadcast receivers in your Manifest

<activity android:name=".MainActivity"
            android:exported="true"
            >
奶茶白久 2025-01-25 11:04:00

您显示的错误图像与错误清单合并相关。我以前见过这个错误,所以我建议你一定要看看这个答案。

检查这个答案清单合并失败..

也许会有帮助..

The error image you have shown is related to the error manifest merger. I have seen this error before, so i recommend that you must see this answer.

Check this answer : Manifest merger failed..

maybe it will help..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文