while installing any third-party package in Flutter and try to run my code it always to go an error that there is no namespace found in build gradle file

for an example this one

A problem occurred configuring project ':google_mlkit_commons'.
> 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.

so to solve it i should go to the mentioned package for example here is ':google_mlkit_commons' and go throw its android files and get the build gradle then adding its namespace in android tag for our example

android {
    namespace "com.google_mlkit_text_recognition"
    compileSdkVersion 31

my questions are
1- should I do this step for each package I want to use?
2- why get this error now? is it related to the new flutter version?

flutter doctor -v

[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.19045.3930], locale en-US)
    • Flutter version 3.16.5 on channel stable at C:Usersengmaflutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (4 weeks ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) 
    • Android SDK at C:UsersengmaAppDataLocalAndroidsdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:Program FilesAndroidAndroid Studiojbrbinjava       
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:Program FilesGoogleChromeApplicationchrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2023.1)
    • Android Studio at C:Program FilesAndroidAndroid Studio
    • Flutter plugin can be installed from:
    • Dart plugin can be installed from:
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.85.1)
    • VS Code at C:UsersengmaAppDataLocalProgramsMicrosoft VS Code
    • Flutter extension version 3.80.0

[√] Connected device (4 available)
    • DRA LX2 (mobile)  • 5LX9K18817915788 • android-arm64  • Android 8.1.0 (API 27)
    • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [Version 10.0.19045.3930]
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 120.0.6099.217
    • Edge (web)        • edge             • web-javascript • Microsoft Edge 120.0.2210.133

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.