这会导致构建错误:processDebugManifest/path/to/project/platforms/android/AndroidManifest.xml:31:5 错误:元素在 AndroidManifest.xml:31:5 中使用-feature#android.hardware.camera 与在 AndroidManifest.xml:27:5 中声明的元素重复/path/to/project/platforms/android/AndroidManifest.xml:32:5 错误:元素在 AndroidManifest.xml:32:5 处使用-feature#android.hardware.camera.autofocus 与在 AndroidManifest.xml:28:5 处声明的元素重复/path/to/project/platforms/android/AndroidManifest.xml:0:0 错误:验证失败,退出:processDebugManifest 失败.....错误构建平台之一:错误:/path/to/project/platforms/android/cordova/build:命令失败,退出代码为 1您可能没有构建此项目所需的环境或操作系统编译后的清单在构建时具有以下内容:...<uses-feature android:name="android.hardware.camera" android:required="false"/><uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/><uses-feature android:name="android.hardware.camera.flash" android:required="false"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-feature android:name="android.hardware.camera"/><uses-feature android:name="android.hardware.camera.autofocus"/>...我能做些什么来解决这个问题吗?科尔多瓦 5.4.1 版 解决方案 我在使用cordova-plugin-camera 和phonegap-plugin-barcodescanner 时遇到了理智的问题.我的修复:ionic cordova 平台 rm android离子cordova平台rm ios离子cordova插件rm phonegap-plugin-barcodescannerrm -r 插件rm -r node_modulesrm 包-lock.json接下来删除package.json的phonegap-plugin-barcodescanner.运行:npm 安装离子cordova平台添加android接下来做一个新的构建:ionic cordova 运行 android接下来再次添加插件:ionic cordova plugin add phonegap-plugin-barcodescannerI am using two different plugins into cordova, which both have the same uses-feature, one with android:required="false" and one without.This results in an error upon build:processDebugManifest/path/to/project/platforms/android/AndroidManifest.xml:31:5 Error: Element uses-feature#android.hardware.camera at AndroidManifest.xml:31:5 duplicated with element declared at AndroidManifest.xml:27:5/path/to/project/platforms/android/AndroidManifest.xml:32:5 Error: Element uses-feature#android.hardware.camera.autofocus at AndroidManifest.xml:32:5 duplicated with element declared at AndroidManifest.xml:28:5/path/to/project/platforms/android/AndroidManifest.xml:0:0 Error: Validation failed, exiting:processDebugManifest FAILED.....ERROR building one of the platforms: Error: /path/to/project/platforms/android/cordova/build: Command failed with exit code 1You may not have the required environment or OS to build this projectThe compiled manifest has the following when built:... <uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <uses-feature android:name="android.hardware.camera.flash" android:required="false" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" />...Is there anything I can do to fix this?cordova version 5.4.1 解决方案 I had the sane issue with cordova-plugin-camera and phonegap-plugin-barcodescanner. My fix:ionic cordova platform rm androidionic cordova platform rm iosionic cordova plugin rm phonegap-plugin-barcodescannerrm -r pluginsrm -r node_modulesrm package-lock.jsonNext remove the phonegap-plugin-barcodescanner of the package.json.Run:npm installionic cordova platform add androidNext do a new build:ionic cordova run androidNext add the plugin again:ionic cordova plugin add phonegap-plugin-barcodescanner 这篇关于Cordova Android 从两个插件中复制了使用功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!