I recently followed a YouTube tutorial to create an application using Flutter’s super_drag_and_drop
package and when I tried running the project, it returned an error as shown below in the debug console.
Launching libmain.dart on Android SDK built for x86 64 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':super_native_extensions'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
> Namespace not specified. Please specify a namespace in the module's build.gradle file like so:
android {
namespace 'com.example.namespace'
}
If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
* 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
Exited (1).
I am new to all of this and don’t really know how to fix it. Can someone please explain what is going on here? Thank you.
I have previously done multiple small projects and always had some issues with the build.gradle. Never was able to resolve them unfortunately as I don’t understand how this gradle thing works. The thing is this error only occurs when I use the android studio device emulator. If I run it on chrome, it doesn’t have the issue.
Hazel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.