Android studio: No variants found for ':mauron85_react-native-background-geolocation'

Viewed 29

I am working on react native app that will has a background location tracker, I am using this library "https://github.com/mauron85/react-native-background-geolocation"

But when I try to build the application on android the gradle failed with the error:

No variants found for ':mauron85_react-native-background-geolocation'. Check build files to ensure at least one variant exists.

here is the content of the build.gradle file

buildscript {
ext {
    buildToolsVersion = "30.0.2"
    minSdkVersion = 21
    compileSdkVersion = 33
    targetSdkVersion = 33
    supportLibVersion = "28.0.0"
    googlePlayServicesVersion = "11+"
    ndkVersion = "21.4.7075529"
    kotlin_version = "1.6.0" // Update this to your version
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle:4.2.2")
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

I am using react native version "0.67.3"

1 Answers

using this properties in variables.gradle the message disappear, compile successfully and work

ext {
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
androidxActivityVersion = '1.2.0'
androidxAppCompatVersion = '1.2.0'
androidxBrowserVersion = '1.3.0'
androidxLocalbroadcastmanagerVersion = '1.0.0'
androidxCoordinatorLayoutVersion = '1.1.0'
androidxCoreVersion = '1.3.2'
androidxFragmentVersion = '1.3.0'
playServicesLocationVersion = '17.0.0'
junitVersion = '4.13.1'
androidxJunitVersion = '1.1.2'
androidxEspressoCoreVersion = '3.3.0'
cordovaAndroidVersion = '7.0.0'
}

or update to v1.0.3 version

Related