简体   繁体   English

如何解决我的 flutter 应用程序的 androidmanifest.xml 中的此 firebase 消息传递错误?

[英]How do I resolve this firebase messaging error in the androidmanifest.xml of my flutter application?

I was following the steps here, https://pub.dev/packages/firebase_messaging#-readme-tab- , to display notifications in my emulator, but I am getting this error in the flutter terminal,我按照此处的步骤https://pub.dev/packages/firebase_messaging#-readme-tab-在我的模拟器中显示通知,但在 flutter 终端中出现此错误,

What went wrong: Execution failed for task ':app:generateDebugBuildConfig'.出了什么问题:任务“:app:generateDebugBuildConfig”执行失败。 org.xml.sax.SAXParseException; org.xml.sax.SAXParseException; systemId: file:/C:/Users/steve/Repos/off-top-flutter/android/app/src/main/AndroidManifest.xml; systemId:文件:/C:/Users/steve/Repos/off-top-flutter/android/app/src/main/AndroidManifest.xml; lineNumber: 17;行号:17; columnNumber: 44;列号:44; Attribute "name" bound to namespace "http://schemas.android.com/apk/res/android" was already specified for element "application".>已为元素“application”指定了绑定到命名空间“http://schemas.android.com/apk/res/android”的属性“name”。>

Below is my code in the AndroidManifest.xml:下面是我在 AndroidManifest.xml 中的代码:

<application
        android:name=".Application"
        android:name="io.flutter.app.FlutterApplication"
        android:label="off_top_mobile"
        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|uiMode"
            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>


            <intent-filter>
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

        </activity>

    </application>

You have the android:name attribute specified twice in your application element:您在应用程序元素中指定了两次android:name属性:

<application
        android:name=".Application"
        android:name="io.flutter.app.FlutterApplication"

You can have only one.你只能拥有一个。 You probably just want to keep whichever one you started with, and not the one you added.您可能只想保留您开始使用的那个,而不是您添加的那个。

暂无
暂无

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

相关问题 开发flutter应用程序时无法解析androidmanifest.xml中的符号 - cannot resolve symbols in androidmanifest.xml while developing flutter application 将 firebase 消息传递服务添加到我的 AndroidManifest.xml 文件时,清单合并失败并出现多个错误 - Manifest merger failed with multiple errors when adding firebase messaging service to my AndroidManifest.xml file 如何在AndroidManifest.xml中为Firebase添加一个钩子进行初始化? - How can I add a hook in the AndroidManifest.xml for Firebase to initialize? 如何在AndroidManifest.xml中将多个自定义应用程序指定为我的应用程序? - How can i specify more than 1 custom application as my application in AndroidManifest.xml? android运行我的应用程序给出错误,我在AndroidManifest.xml中缺少android:configChanges的AdActivity - android run my application give error i missing AdActivity with android:configChanges in AndroidManifest.xml 在我的设备上哪里可以找到 Androidmanifest.xml? - Where do I find Androidmanifest.xml on my device? 如何从Java下拉AndroidManifest.xml中列出的应用程序版本? - How Do I Pull The Application Version Listed in AndroidManifest.xml From Java? 如何在AndroidManifest.xml中参数化Activity - How do I parameterize an Activity from within AndroidManifest.xml AndroidManifest.xml 错误,我该如何解决这个问题? - AndroidManifest.xml error, how can I solve this problem? AndroidManifest.xml中的错误 - Error in AndroidManifest.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM