I am getting the following error on npx cap open android
Caused by: org.gradle.api.resources.MissingResourceException: Could not read script '/Users/adk/Documents/projectA/node_modules/cordova-androidx-build/src/android/cordova-androidx-build.gradle' as it does not exist.
I have cordova-androidx-build installed and cordova-androidx-build.gradle file is present in node_modules of my project. The node_modules folder has read-write access as well. Any help is much appreciated.
I posted the question after trying for 2 days in vain and within an hour after posting the question, I found the solution. So for all those future seekers, you can follow the following steps to fix it.
This fixed it mysteriously, no idea how.