【问题标题】:React Native - react-native-camera error building on AndroidReact Native - 在 Android 上构建 react-native-camera 错误
【发布时间】:2018-03-29 20:40:24
【问题描述】:

我整天都在为此苦苦挣扎。 我做了和repo 说的一样的事情。

我跑了:

npm install react-native-camera --save

react-native link react-native-camera

输出表明一切都正确链接。 但是当我这样做时:

react-native run-android

我收到此错误:

\MainApplication.java:6: error: package org.reactnative.camera does not exist import org.reactnative.camera.RNCameraPackage; ^

FAILURE:构建失败并出现异常。

  • 出了什么问题:任务 ':app:compileDebugJavaWithJavac' 执行失败。

这不是整个错误,我认为这只是其中最相关的部分。

任何手?

【问题讨论】:

  • 您是否尝试为android手动安装它???
  • 是的,我收到此错误:Execution failed for task ':react-native-camera:processReleaseResources'. > Error: more than one library with package name 'com.google.android.gms.license'

标签: react-native react-native-android react-native-camera


【解决方案1】:

在 android/app/build.gradle 的依赖块中插入以下行:

compile (project(':react-native-camera')) {
    exclude group: "com.google.android.gms"
    compile 'com.android.support:exifinterface:25.+'
    compile ('com.google.android.gms:play-services-vision:12.0.1') {
        force = true
    }
}

您可能需要使用不同的 exifinterface 版本,例如27.+ 而不是 25.+。

https://github.com/react-native-community/react-native-camera

在安卓上手动安装的第四步。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-31
    • 2017-06-26
    • 1970-01-01
    • 1970-01-01
    • 2020-06-28
    • 1970-01-01
    • 2020-03-10
    相关资源
    最近更新 更多