Having version problems with Ionic and Gradle

Good day. I tried a fresh install of an Ionic project 7.2, Java 20, and Gradle 8.3. As this is the partnered version for Java and Gradle support to run on android. At this point, I can run the project externally.
But when I tried to install google maps using capacitor, it messes returns an error.

I tried using different version of Java and Gradle, still the same. The error only happens when I run it on android. The project runs if I only use ‘ionic serve’ and open it using browser.

But I need to make the app run on android. Thanks for any help or insights where the problem might be.