element at AndroidManifest. xml:16:5-39:19 覆盖-6ren"> element at AndroidManifest. xml:16:5-39:19 覆盖-我遇到这个错误 Error: Attribute application@label value=(flutter_bloc_pattern) from AndroidManifest.xml:18:-6ren">
gpt4 book ai didi

android - 添加 'tools:replace="android :label"' to element at AndroidManifest. xml:16:5-39:19 覆盖

转载 作者:IT王子 更新时间:2023-10-29 06:53:44 25 4
gpt4 key购买 nike

我遇到这个错误

Error: Attribute application@label value=(flutter_bloc_pattern) from AndroidManifest.xml:18:9-45 is also present at [:DynamsoftBarcodeReader] AndroidManifest.xml:13:9-41 value=(@string/app_name).

构建失败并出现错误

 C:\Users\user\AndroidStudioProjects\Flutter Example\Flutter BLoC Pattern\android\app\src\main\AndroidManifest.xml:18:9-45 Error:
Attribute application@label value=(flutter_bloc_pattern) from AndroidManifest.xml:18:9-45
is also present at [:DynamsoftBarcodeReader] AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:16:5-39:19 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@label value=(flutter_bloc_pattern) from AndroidManifest.xml:18:9-45
is also present at [:DynamsoftBarcodeReader] AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:16:5-39:19 to override.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Finished with error: Gradle task assembleDebug failed with exit code 1

我的 list 是这样的

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nz.co.plumbingworld.flutterblocpattern">

<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_bloc_pattern"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

最佳答案

错误信息告诉你在你AndroidManifest.xml你的android:label具有值(value) flutter_bloc_pattern已经存在于(库/插件/项目)DynamsoftBarcodeReader 的 list 中.

您可以按照错误提示添加 tools:replace="android:label"给你的<application> list 中的节点

<application
tools:replace="android:label"
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_bloc_pattern"
android:icon="@mipmap/ic_launcher">

如果添加 tools您还需要添加模式的属性

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="nz.co.plumbingworld.flutterblocpattern">

关于android - 添加 'tools:replace="android :label"' to <application> element at AndroidManifest. xml:16:5-39:19 覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54924256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com