react-native-background-geolocation: Could not find any matches for com.transistorsoft:tslocationmanager:+ as no versions of com.transistorsoft:tslocationmanager are available.

Your Environment

  • Plugin version: 2.12.2
  • Platform: Android
  • React Native version (react-native -v):0.51.0

Expected Behavior

I installed react-native-background-geolocation, linked it according to the documentation with react-native link and ran react-native run-android. Builds successfully on Ios but build fails on Android.

Actual Behavior


* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not find any matches for com.transistorsoft:tslocationmanager:+ as no versions of com.transistorsoft:tslocationmanager are available.
     Required by:
         project :app > project :react-native-background-geolocation

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Steps to Reproduce

  1. react-native unlink react-native-background-geolocation
  2. react-native uninstall react-native-background-geolocation
  3. yarn add react-native-background-geolocation
  4. react-native link react-native-background-geolocation
  5. react-native link react-native-background-fetch

Context

I was trying to set up react-native-background-geolocation on an app.

Debug logs

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 32 (15 by maintainers)

Most upvoted comments

Did you read the Setup docs for react-Native link?

There’s a required manual step with a required maven url

facing same issue

“react-native”: “0.74.3”, “react-native-background-fetch”: “4.2.5”, “react-native-background-geolocation”: “4.17.3-rc.1”,

my build.gradle file:

buildscript {
    ext {
        buildToolsVersion = "34.0.0"
        minSdkVersion = 23
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "26.1.10909125"
        kotlinVersion = "1.9.22"
        appCompatVersion 	= "1.4.2"
        googlePlayServicesLocationVersion = "21.0.1"  
    }
    repositories {
        google()
        mavenCentral()

        maven { url 'https://maven.google.com' }
        maven { url "https://www.jitpack.io" }
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}")
        classpath("com.google.gms:google-services:4.4.2")
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()

        // Required for react-native-background-geolocation
        maven { url("${project(':react-native-background-geolocation').projectDir}/libs") }
        maven { url 'https://developer.huawei.com/repo/' }

        // Required for react-native-background-fetch
        maven { url("${project(':react-native-background-fetch').projectDir}/libs") }
    }
}

apply plugin: "com.facebook.react.rootproject"

Post your android/build.gradle

If I’m trying to use the key for another app, do I need to buy a new key?

Yes.

hey @christocracy, read through the thread. I have an expired order, I did create and use the key last year. If I’m trying to use the key for another app, do I need to buy a new key?

@christocracy my android/build.gradle file.

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        googlePlayServicesLocationVersion = "19.0.1"
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
        appCompatVersion = "1.1.0" 
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.1")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        // react-native-background-geolocation START
        maven {
            // Required for react-native-background-geolocation
            url("${project(':react-native-background-geolocation').projectDir}/libs")
        }
        maven {
            // Required for react-native-background-fetch
            url("${project(':react-native-background-fetch').projectDir}/libs")
        }
        // react-native-background-geolocation END

        google()
        maven { url 'https://www.jitpack.io' }
    }
}

Create a hello world app and follow the setup instructions.