After upgrading my Flutter project to Gradle v8 and AGP v8, I'm getting:
$ flutter build apk --debug
Changing current working directory to: /Users/bartek/dev/leancode/patrol/packages/patrol/example
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':flutter_timezone'.
> 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 538ms
After upgrading my Flutter project to Gradle v8 and AGP v8, I'm getting:
As a temporary workaround, I'm doing: