反应本地地图构建错误

时间:2018-08-01 15:03:01

标签: react-native

在我的项目中添加了反应本机地图后,出现此错误

在项目':react-native-maps'中与依赖项'com.android.support:support-v4'发生冲突。编译(26.1.0)和打包(24.0.0)的已解决版本不同。由于资源不匹配,这可能会生成运行时错误。 :react-native-maps:prepareReleaseDependencies失败

我的依赖

dependencies {
    compile "com.android.support:appcompat-v7:24.0.0"
    compile fileTree(dir: "libs", include: ["*.jar"])
    // compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile(project(':react-native-maps')){
       exclude group: 'com.google.android.gms', module: 'play-services-base'
       exclude group: 'com.google.android.gms', module: 'play-services-maps'
   }
   compile 'com.google.android.gms:play-services-base:10.0.1'
   compile 'com.google.android.gms:play-services-maps:10.0.1'
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

我的环境

>  React Native Environment Info:
>     System:
>       OS: Linux 4.15 Ubuntu 16.04.4 LTS (Xenial Xerus)
>       CPU: x64 Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz
>       Memory: 371.00 MB / 7.71 GB
>       Shell: 4.3.48 - /bin/bash
>     Binaries:
>       Node: 8.11.3 - /usr/bin/node
>       npm: 5.6.0 - /usr/bin/npm
>       Watchman: 4.7.0 - /usr/local/bin/watchman
>     SDKs:
>       Android SDK:
>         Build Tools: 23.0.1, 24.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0
>         API Levels: 23, 24, 25, 26, 27, 28
>     npmPackages:
>       react: 16.4.1 => 16.4.1 
>       react-native: 0.56.0 => 0.56.0 
>     npmGlobalPackages:
>       react-native-cli: 2.0.1

0 个答案:

没有答案