buildscript { // The Android Gradle plugin is only required when opening the android folder stand-alone. // This avoids unnecessary downloads and potential conflicts when the library is included as a // module dependency in an application project. if (project == rootProject) { repositories { google() jcenter() } dependencies { classpath("com.android.tools.build:gradle:3.6.3") } } } def getExtOrInitialValue(name, initialValue) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : initialValue } def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeNetInfo_' + name] } def getExtOrIntegerDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativeNetInfo_' + name]).toInteger() } apply plugin: 'com.android.library' android { compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') defaultConfig { minSdkVersion getExtOrIntegerDefault('minSdkVersion') targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') } lintOptions{ abortOnError false } } repositories { maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } google() jcenter() mavenCentral() } dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' def supportLibVersion = getExtOrInitialValue('supportLibVersion', getExtOrInitialValue('supportVersion', null)) def androidXVersion = getExtOrInitialValue('androidXVersion', null) def androidXCore = getExtOrInitialValue('androidXCore', null) if (supportLibVersion && androidXVersion == null && androidXCore == null) { implementation "com.android.support:appcompat-v7:$supportLibVersion" } else { def defaultAndroidXVersion = "1.3.2" if (androidXCore == null) { androidXCore = androidXVersion == null ? defaultAndroidXVersion : androidXVersion } implementation "androidx.core:core:$androidXCore" } }