Using the packageName extracted from the AndroidManifest.xml,
You shold remove package form AndroidManifest.xml file.
Add a namespace property under the android block in the build.gradle file.
Like this:
// build.gradle
android {
namespace "packageName"
...
}
See detail : https://discuss.gradle.org/t/namespace-not-specified-for-agp-8-0-0/45850