【问题标题】:Ionic native camera plugins conflicting离子原生相机插件冲突
【发布时间】:2017-10-17 10:03:11
【问题描述】:

我已经安装了插件cordova-plugin-camera-previewlink。安装后,如果我运行ionic cordova build android,应用程序构建良好。

不过,我还需要使用插件phonegap-plugin-barcodescannerlink,所以我也安装了这个。现在,当我尝试运行 ionic cordova build android 时,构建失败并出现以下错误:

    Error:
    Element uses-feature#android.hardware.camera at AndroidManifest.xml:21:5-84 duplicated with element declared at 
AndroidManifest.xml:18:5-60
/Users/Dan/Projects/test/testApp/platforms/android/AndroidManifest.xml Error:
    Validation failed, exiting


See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:processDebugManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

如果我再次删除这些插件之一,它构建得很好。我尝试编辑 AndroidManifest.xml 并删除重复的行,但是当我尝试构建时,它们又回来了。是否可以同时使用这些插件?

感谢您的帮助。

编辑:

我也试过删除这条线:

<uses-feature android:name="android.hardware.camera" android:required="true"/> 来自plugins/phonegap-plugin-barcodescanner/plugin.xml

<uses-feature android:name="android.hardware.camera" /> 来自plugins/cordova-plugin-camera-preview/plugin.xml

但这没有帮助。

【问题讨论】:

  • AndroidManifest.xml 中只声明一次权限。由于多个声明而出现错误。

标签: android cordova ionic-framework ionic2 cordova-plugins


【解决方案1】:

我删除了这条线:

<uses-feature android:name="android.hardware.camera" /> 来自:

plugins/cordova-plugin-camera-preview/plugin.xml

这仍然没有用,直到我跑了:

  1. ionic cordova platform rm android

  2. ionic cordova platform add android

  3. ionic cordova build android

可能不是最好的解决方案,但它的工作原理!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-19
    • 2019-04-04
    • 2017-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多