FAILURE: Build failed with an exception. * What w...
# community-support
q
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':flutter_secure_storage'.
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: C:\Users\traco\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_secure_storage-7.0.1\android\build.gradle. 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.
d
This isn't a Gradle issue. This is a flutter issue. Since flutter plugins compile as module in your project instead of having an already compiled binary (bad idea on the flutter part) they suffer from incompatibilities in versions between your Gradle plugins and the Gradle plugins versions expected by the flutter plugin.. + other requirements In this case the android Gradle plugin in your project expects and requires all modules to have a namespace, but you have at least one flutter plugin that doesn't have the namespace configured in the android library Gradle file. If you are lucky the namespace issue is in your code and you can fix it, if it's a plugin you need to hope there's a more recent version... This is one of the reasons I dislike flutter :-)
v
Iirc you can hack around it by using highly discouraged cross-project configuration. But you should really get the dependency maintainer to update their project to be compatible with newer AGP versions like @Daniele Segato said. There are also many threads about this already here and also in the forums. Please at least do a minimal research before asking questions. Not doing so is one of the main characteristics of a help vampire.