How to fix 'Android Gradle plugin 3.6.1 must not be applied to project since version 3.6.1 was already applied to this project'?

I am a complete beginner using Ionic Angular, I want to test my project in Android. After executing npx cap open android in my terminal, it opened on Android Studio and started gradle sync, the Gradle Sync failed. Here is the error message:

Android Gradle plugin 3.6.1 must not be applied to project ‘/Users/zerobstacle/Desktop/ionic/water-meter/android/capacitor-cordova-android-plugins’ since version 3.6.1 was already applied to this project

I have already tried doing the same to other Ionic projects and the gradle sync finished successfully. This problem came (I think) after trying to add Firebase Vision to my project. Please let me know if you need to see some files in my project. Thank you so much!