Namespace not specified for AGP 8.0.0

Hi! Need some help with Android Gradle Plugin update. When I try to update project from 7.4.2 to 8.0.0 I get an error:

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.

Namespaces have been set already with 7.4.2 and everything works as expected - what should I do to get rid of this error?
I see on Google that there is / was some sort of bug with this, but didn’t find any suggestions on what should be done.

did u update it with the AGP Upgrade Assistant? let me know please.

Yes, but issue seems to be caused by libraries I am using. They are not up to date with Gradle requirement for namespaces.

normally,it will add namespace automictically in the dependent mocule’s build.gradle file when u update AGP with AGP Upgrade Assistant. u can remove the “package” attribute in the AndroidManifest.xml file, and add the namespace line under android{} in buile.gradle file, if AGP Upgrade Assistant failed.

You can resolve the namespace issue after updating to AGP 8.+ by adding the following script in the android/build.gradle file:

subprojects {
   afterEvaluate { project ->
       if (project.hasProperty('android')) {
           project.android {
               if (namespace == null) {
                   namespace project.group
               }
           }
       }
   }
}