To fix the Gradle sync error, follow these steps:
repositories { google() mavenCentral() } // Replace JCenter with Maven Central
./gradlew cleanBuildCache
Check Network/Proxy: Ensure your new machine has the correct network settings and no proxy is blocking the connection.
Update Gradle Version (Optional): Update Gradle by running:
./gradlew wrapper --gradle-version <latest_version>
systemProp.gradle.ssl.verify=false