无法解决::tslocationmanager:

时间:2018-10-28 03:47:36

标签: android react-native gradle build.gradle

我在Android Studio中同步有关“ react-native-background-geolocation”软件包的项目时遇到问题。

  

无法解决::tslocationmanager:

运行./gradlew:app:dependencies会出现以下错误:

A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration 
':app:_debugApkCopy'.
   > Could not find :tslocationmanager:.
     Required by:
         MyAppName:app:unspecified
         MyAppName:app:unspecified > MyAppName:react-native-background-geolocation:unspecified

我没有遵循 here概述的安装说明。

相关的项目级build.gradle:

allprojects {
    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
           url 'https://maven.google.com'
        }
        maven {
            url "$rootDir/../node_modules/react-native-background-geolocation/android/libs"
        }
        maven {
            url "$rootDir/../node_modules/react-native-background-fetch/android/libs"
        }
    }
}

以及相关的应用程序级build.gradle:

dependencies {
    compile "com.android.support:support-core-utils:28.0.0"
    compile project(':react-native-background-geolocation')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:26.1.0"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile "me.leolin:ShortcutBadger:1.1.19@aar"
    compile(name: 'tslocationmanager', ext: 'aar')
}

1 个答案:

答案 0 :(得分:0)

tslocationmanagerreact-native-background-geolocation的一部分-很可能不需要直接引用-将compile(name: 'tslocationmanager', ext: 'aar')替换为compile project(':react-native-background-fetch')。见他们的GitHub