Suddenly I’m getting the namespace error in my flutter project.
- What went wrong:
A problem occurred evaluating root project ‘android’.
A problem occurred configuring project ‘:app’.
Could not create an instance of type com.android.build.api.variant.impl.ApplicationVariantImpl.
> 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.
enter code here
Thank you in advance for the help.
2
Answers
Read what the error tells you.
In newer versions of AGP, the declaration of namespace/package was moved from AndroidManifest and to build script.
and
Upgrade the Java version to 17 in the app-level build.gradle file. This adjustment should resolve the issue in my scenario.[1]: https://phpout.com/wp-content/uploads/2024/02/8zRn6.png