将 Google 移动广告 SDK 添加到 Flutter 时出错

Error when adding Google Mobile Ads SDK to Flutter

提问人:AlluMl 提问时间:9/22/2023 最后编辑:AlluMl 更新时间:9/22/2023 访问量:53

问:

我在尝试将 Google 移动广告 SDK 集成到我的 Flutter 项目中时遇到了问题。当我将依赖项添加到我的 pubspec.yaml 文件并尝试构建项目时,出现以下错误:

A problem occurred configuring project ':google_mobile_ads'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

I have followed the steps outlined in the documentation and from the Youtube tutorial [video][1] but I can't seem to resolve this issue. Can anyone provide guidance on how to fix this error?

其他信息:

Flutter 版本:3.13.1, Android Studio 版本:2022.3 Google 移动广告 SDK 版本:3.0.0

Android Flutter android-gradle-plugin admob google-mobile-ads

评论


答: 暂无答案