接收:为我的多个包配置项目时出现问题


经过很长时间,我正在处理我的一个项目,所以我也更新了我的 flutter 代码和包。 我开始收到错误:为“包名称”配置项目时出现问题。 起初,它是针对 cloud firestore 和 firebase 的,但后来我重新安装了 firebase,所以这个问题得到了解决,然后我得到了 shareplus 和其他一些包,这些包通过在包的特定 build.gradle 中添加命名空间来解决,但我仍然收到其他包一一列出。 现在我有 video_player 包。

在大多数情况下,错误看起来有点像这样

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':video_player_android'.
> 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.

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1

我尝试过的:

我为此尝试了相同的解决方案,但无法解决。 我已经尝试过其他一些方法,例如:

从所有 androidxml 中删除包“命名空间” 在我的应用程序级别 android 文件中添加命名空间 将依赖项更新为:classpath ‘com.android.tools.build:gradle:8.2.0’ // 更新到较新版本的 classpath “org.jetbrains. kotlin:kotlin-gradle-plugin:$kotlin_version” classpath ‘com.google.gms:google-services:4.4.0’ // Google 服务插件

安装了 Java 17,在 gradle.properties 中添加了这一行: org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home

最近在全局 buildgradle 中的子项目文件夹中添加了命名空间

我还能做什么以及如何确保此错误在全局范围内得到解决?

コメント

タイトルとURLをコピーしました