在配置react-native-maps中获取“ supportLibVersion”,“ playServicesVersion”和“ androidMapsUtilsVersion”值

时间:2019-11-11 17:38:37

标签: javascript react-native google-play-services react-native-android react-native-maps

我正在安装react-native-maps。在安装指南中第3.1节的Build configuration on Android上,它显示:

buildscript {
    ext {
        buildToolsVersion = "xxx"
        minSdkVersion = xxx
        compileSdkVersion = xxx
        targetSdkVersion = xxx
        supportLibVersion = "xxx"
        playServicesVersion = "xxx" // or set latest version
        androidMapsUtilsVersion = "xxx"
    }
}
...

如何获取supportLibVersionplayServicesVersionandroidMapsUtilsVersion的值?

2 个答案:

答案 0 :(得分:20)

通常,所有库都可以在Maven存储库中找到。对于某些人来说,您必须看到一个具体的库以获取版本号(该数字是您在build.grade文件中输入的数字)。通常,属于一个组的所有库都应支持相同的版本号(否则会出现编译错误,您需要检查具体版本并确保所需的库存在该版本)。

googlePlayServicesVersion:
https://mvnrepository.com/artifact/com.google.android.gms/play-services-maps

androidMapsUtilsVersion:
https://mvnrepository.com/artifact/com.google.maps.android/android-maps-utils

supportLibVersion:
https://mvnrepository.com/search?q=com.android.support
在库中查看。例如https://mvnrepository.com/artifact/com.android.support/appcompat-v7

答案 1 :(得分:3)

尝试一下:

ext {
    compileSdkVersion           = 28
    targetSdkVersion            = 28
    buildToolsVersion           = "28.0.3"
    googlePlayServicesVersion   = "17.0.0"
    supportLibVersion           = "27.1.0"
    androidMapsUtilsVersion     = "0.5+"
    minSdkVersion               = 16
}