繁体   English   中英

安装React-Native-camera后无法构建

[英]Impossible to build after installing React-Native-camera

在连接了react-native-camera之后,我整天试图构建我的项目。 我认为问题来自于依赖项和google-play-service,但我不确定。

我尝试了许多其他配置,即使构建错误不同,也无法构建...

我上次遇到的错误是:

Android依赖项“ com.google.android.gms:play-services-base”对于编译(11.8.0)和运行时(12.0.1)类路径具有不同的版本。 您应该通过DependencyResolution手动设置相同的版本

这些是我得到的依赖:

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation project(':tipsi-stripe')
    implementation "com.facebook.react:react-native:+"
    implementation project(':react-native-maps')
    implementation project(':react-native-camera')
    implementation 'com.google.firebase:firebase-core:10.0.1'
    implementation "com.android.support:appcompat-v7:23.0.1"
    implementation 'com.google.android.gms:play-services-base:10.0.1'
    implementation 'com.google.android.gms:play-services-maps:10.0.1'
}

在此github论坛中对此进行了讨论,提供的解决方案是在依赖项中使用com.google.android.gms:play-services-vision:11.8.0 ':

dependencies {
  compile 'com.facebook.react:react-native:+'
  compile "com.google.zxing:core:3.2.1"
  compile "com.drewnoakes:metadata-extractor:2.9.1"
  compile 'com.google.android.gms:play-services-vision:11.8.0'
  compile "com.android.support:exifinterface:+"

  compile 'com.github.react-native-community:cameraview:cc47bb28ed2fc54a8c56a4ce9ce53edd1f0af3a5'
}

只需跟随: React-Native-Camera

最重要的是,请按照以下步骤操作:App Gradle:

dependencies {
    compile project(':react-native-camera')
    api project(':react-native-vector-icons')
    api project(':react-native-i18n')
    api fileTree(include: ['*.jar'], dir: 'libs')
    api 'com.android.support:appcompat-v7:26.0.1'
    api 'com.facebook.react:react-native:+'
    // From node_modules
}

所有项目下面的项目Gradle:

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.1.0"
            }
        }
    }
}

让我知道该插件是否仍然存在问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM