反应Native Maps依赖关系问题

时间:2019-02-14 18:04:40

标签: maven google-maps react-native gradle

我目前正在尝试将Google Maps集成到我的React Native应用程序(Android端)中,并遵循官方文档中提供的所有安装步骤,但是存在一些依赖性问题。

在尝试了数千种可用解决方案后,最后将其发布在此处。

ERROR: Unable to resolve dependency for ':react-native- 
maps@debug/compileClasspath': Could not resolve 
com.android.support:support-annotations:25.2.0.
Show Details
Affected Modules: react-native-maps


ERROR: Unable to resolve dependency for ':react-native- 
maps@debug/compileClasspath': Could not resolve 
com.android.support:support-core-utils:25.2.0.
Show Details
Affected Modules: react-native-maps

我已将依赖资源从

更改为
  

maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" }

`maven {
        url 'https://maven.google.com/'
        name 'Google'
    }`

并修复了react-native-map的依赖关系问题,但又遇到了另一个问题

'error: cannot find symbol
 @ReactMethod(isBlockingSynchronousMethod = true)'

我同时添加了两个Maven资源,以便可以像这样相应地获取依赖项

`allprojects {
repositories {
    mavenLocal()
    google()
    jcenter()

    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
    }
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
}
}

,但是再次出现地图依赖问题。请注意,当我将maven.google.com添加为获取依赖项的唯一资源时,依赖项问题已得到解决。

0 个答案:

没有答案