[英]react-native-camera (android): takePictureAsync() throws error
[英]react-native-camera build error on android
嗨,我正在使用以下堆栈:-react-native-camera 1.1.1-react-native 0.55.3-gradle 3.1.2
我完成了文档中描述的用于链接项目的所有步骤( https://github.com/react-native-community/react-native-camera )。
gradle同步成功结束,但是当我尝试构建项目时,出现很多错误:
/node_modules/react-native-camera/android/src/main/java/org/reactnative/camera/RNCameraView.java:15: error: package com.google.android.cameraview does not exist
导入com.google.android.cameraview.CameraView;
其他错误看起来相同(未找到CameraView)...
这是我的gradle文件:
dependencies {
compile project(':react-native-video')
implementation project(':react-native-vector-icons')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-languages')
implementation project(':react-native-i18n')
implementation project(':react-native-background-timer')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.+"
implementation "com.facebook.react:react-native:+" // From node_modules
compile (project(':react-native-camera')) {
compile 'com.android.support:exifinterface:27.+'
compile ('com.google.android.gms:play-services-vision:12.0.1') {
force = true
}
}
}
谢谢你的帮助!
通过从react-native-camera中排除com.android.support来解决此问题:
compile (project(':react-native-camera')) {
exclude group: "com.google.android.gms"
exclude group: "com.android.support" // --> this line
compile 'com.android.support:exifinterface:27.+'
compile ('com.google.android.gms:play-services-vision:12.0.1') {
force = true
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.