I was hit with the same issue. I ended up doing -rm rf to the caches, the .gradle/ and the daemon. Next I downgraded my gradle version to 8.5: ./gradlew wrapper --gradle-version 8.5. It auto prompted me to use 9.0 on Android Studio and then it worked fine after that and built perfectly.