I have to compile a project purchased on line. On importing it into android studio..it complained about the gradle version so i updated the distributionUrl to this dis
In case you are still getting the error try changing android/build.gradle of your package in node_modules from implementation to compile. Worked for me. You can use the following command inside your project folder.
sed -i -s "s#implementation#compile#" node_modules/your-react-native-package-name/android/build.gradle