简体   繁体   English

AndroidManifest.xml 中的属性 application@allowBackup value=(false) 也存在于 [:barcodescanner:] AndroidManifest.xml value=(true)

[英]Attribute application@allowBackup value=(false) from AndroidManifest.xml is also present at [:barcodescanner:] AndroidManifest.xml value=(true)

I'm trying to set the allowBackup attribute in my ionic 3 app manifest to false but gradle complains with the following error:我正在尝试将 ionic 3 应用程序清单中的 allowBackup 属性设置为 false 但 gradle 抱怨以下错误:

Attribute application@allowBackup value=(false) from AndroidManifest.xml:4:18-45 is also present at [:barcodescanner:] AndroidManifest.xml:12:9-35 value=(true).来自 AndroidManifest.xml:4:18-45 的属性 application@allowBackup value=(false) 也存在于 [:barcodescanner:] AndroidManifest.xml:12:9-35 value=(true)。 Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:4:5-11:19 to override.建议:将 'tools:replace="android:allowBackup"' 添加到 AndroidManifest.xml:4:5-11:19 的元素以覆盖。

To Set allowBackup=false using below line in config.xml file使用 config.xml 文件中的以下行设置 allowBackup=false

<platform name="android"> <edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge"> <application android:allowBackup="false"/> </edit-config> </platform>

I use Barcode Scanner in my ionic 3 app.(Repo: https://github.com/phonegap/phonegap-plugin-barcodescanner recommended in https://ionicframework.com/docs/native/barcode-scanner/ )我在我的 ionic 3 应用程序中使用 Barcode Scanner。(回购: https : //github.com/phonegap/phonegap-plugin-barcodescannerhttps://ionicframework.com/docs/native/barcode-scanner/ 中推荐)

please help me.请帮助我。 Thanks!谢谢!

You have to tell the compiler to ignore the attribute from the external library.您必须告诉编译器忽略来自外部库的属性。 The way to do that is to add this line in application tag:这样做的方法是在应用程序标签中添加这一行:

tools:replace="android:allowBackup"

PS: To access the tools add xmlns:tools="http://schemas.android.com/tools" in the manifest tag at the top. PS:要访问这些工具,请在顶部的清单标签中添加xmlns:tools="http://schemas.android.com/tools"

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

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