Are you using Android Studio Flamingo?
When you open your project the first time on Flamingo it should prompt you to update gradle to version 8 and also moves the namespace from the AndroidManifest.xml to the build.gradle. Unless you ignored it the first time or choose “don’t ask me again”.
You can manually move the package as explained in this step
You can also update gradle with this command cd android && ./gradlew wrapper --distribution-type all --gradle-version 8.0.2 --warning-mode all and manually update gradle plugin version as explained here
If after that Android Studio still complains about Namespace not specified, some plugin is probably not updated to use gradle 8. You can run npx cap sync and it should patch the namespace on plugins that have not been updated yet, but it’s recommended to check if the plugins can be updated first and update to the latest version.
Anyway, it’s way simpler to just run npx cap migrate as it does all those changes automatically.
Thanks - I ran npx cap migrate and also upgraded Android Studio to Flamingo. All the migration steps seem to have worked - apart from me being left with this one issue (and the issue that when I run Tools - Run AGP Upgrade Assistant nothing happens - which might be connected maybe?)