def safeExtGet = { prop, fallback ->
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath("com.android.tools.build:gradle:7.0.4") // Use a recent Gradle version
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion safeExtGet('compileSdkVersion', 31) // Update to a recent SDK version
    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 21) // Update to a reasonable min SDK
        targetSdkVersion safeExtGet('targetSdkVersion', 31)
        versionCode 1
        versionName "1.0"
    }

    buildToolsVersion safeExtGet('buildToolsVersion', '31.0.0') // Update build tools version

    lintOptions {
        abortOnError false
    }
}

repositories {
    google()
    mavenCentral()
}

dependencies {
    // Use implementation instead of compile (deprecated)
    implementation 'com.facebook.react:react-native:+'
}
