How can I change Package name for Android build

I need to change the Package name for my app. The app was initially published with com.appname.app and this was used to publish the app on Playstore. Now there’s need for me to republish the app into another account on playstore, because I don’t want to use the former Playstore account.

I have already unpublished the former app on Playstore, but it requires that I change the Package name in app.json before I can publish the app into a new Google Playstore account.

I tried to change the package name in app.json to com.appname.newapp and then rebuild the app bundle but it keeps generating an error Standalone build failed! in the build process.

How can I change this package name so as to prevent this Standalone build failed! error?

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:processReleaseGoogleServices'.
[stderr] > No matching client found for package name 'REDACTED_PACKAGE_NAME'
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

you changed package name but you are still using google-services file generated for the old package name

Thank you. It worked.