This wraps the Android Gradle plugin dependency in the buildscripts section of android/build.gradle in a conditional:
if (project == rootProject) {
// ... (dependency here)
}
The Android Gradle plugin is only required when opening the project stand-alone, not when it is included as a dependency. By doing this, the project opens correctly in Android Studio, and it can also be consumed as a native module dependency from an application project without affecting the app project (avoiding unnecessary downloads/conflicts/etc).
using the root project gradle setup with a fallback option in case of missing an option
bump default gradle settings versions to match with RN v61+
Also, I saw in commit history that this project has been migrated to RN60+ but in the Android Gradle, there was an android support library dependency 'com.android.support:design:27.1.1'. I didn't see any usage of this dependency in your code so I simply remove it instead of replacing it with Androidx equivalent dependency.
This wraps the Android Gradle plugin dependency in the buildscripts section of android/build.gradle in a conditional:
The Android Gradle plugin is only required when opening the project stand-alone, not when it is included as a dependency. By doing this, the project opens correctly in Android Studio, and it can also be consumed as a native module dependency from an application project without affecting the app project (avoiding unnecessary downloads/conflicts/etc).
for more info, you can refer to this thread and especially this comment.
using the root project gradle setup with a fallback option in case of missing an option
bump default gradle settings versions to match with RN v61+
Also, I saw in commit history that this project has been migrated to RN60+ but in the Android Gradle, there was an android support library dependency
'com.android.support:design:27.1.1'
. I didn't see any usage of this dependency in your code so I simply remove it instead of replacing it with Androidx equivalent dependency.