AndroidManifest.xml 中的 MAUI 依赖错误

问题描述 投票:0回答:1

在尝试向 MAUI android 应用程序添加推送通知时,我开始遇到错误并且无法解决它,我尝试询问 ChatGPT 几次,但没有多大帮助,我尝试添加 android:export 就像 chatgpt 所说的那样,但什么也没有但由于此错误,我无法加载我的应用程序,如果有人可以提供帮助,那将非常有帮助!

`<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.amadaapp">

<!-- Permessi necessari -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:targetApi="28">

    <!-- Configurazione di Firebase Messaging -->
    <service
        android:name=".FirebaseMessagingService"
        android:exported="true">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <!-- Configurazione Firebase Instance ID -->
    <service
        android:name=".FirebaseInstanceIdService"
        android:exported="true">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

    <!-- Configurazione Firebase Remote Config -->
    <service
        android:name="com.google.firebase.remoteconfig.FirebaseRemoteConfigService"
        android:exported="false" />

    <!-- Configurazione Firebase Analytics -->
    <receiver
        android:name="com.google.firebase.analytics.AnalyticsReceiver"
        android:exported="true">
        <intent-filter>
            <action      android:name="com.google.android.gms.analytics.CampaignTrackingReceiver" />
        </intent-filter>
    </receiver>

    <!-- Ricezione delle notifiche all'avvio del dispositivo -->
    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND">
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
            <category android:name="com.example.amadaapp" />
        </intent-filter>
    </receiver>

    <!-- Configurazione per Firebase Crashlytics -->
    <receiver
        android:name="com.google.firebase.crashlytics.internal.analytics.AnalyticsReceiver"
        android:exported="true">
        <intent-filter>
            <action android:name="com.google.firebase.analytics.CampaignTrackingReceiver" />
        </intent-filter>
    </receiver>

    <!-- Definizione dell'activity principale -->
    <activity
        android:name="com.microsoft.maui.MauiAppCompatActivity"
        android:exported="true"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

</manifest>

`

Severity    Code    Description Project File    Line    K 
Suppression State
Error (active)  AMM0000 C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\277\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.abt' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\315\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.ads_identifier' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\290\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.database.collection' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\300\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.installations' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\288\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.firebase_core' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\307\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.storage' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\292\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.dynamiclinks' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\297\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.functions' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\325\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.measurement.sdk.api' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\326\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.measurement.sdk' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\291\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.datatransport' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\302\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.analytics.connector' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\298\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.iid' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\283\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase' used in: AndroidManifest.xml, 
AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\294\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.encoders.json' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\301\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.installations.interop' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\303\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.messaging' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\319\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.cloudmessaging' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\296\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.firestore' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\321\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.measurement.api' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\304\jl\AndroidManifest.xml Warning:
Namespace 'firebase.com.protolitewrapper' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\286\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.remoteconfig' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\318\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.common' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\329\jl\AndroidManifest.xml Warning:
Namespace 'com.google.android.gms.tasks' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\323\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.measurement' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\281\jl\AndroidManifest.xml Warning:
Namespace 'com.google.firebase.auth' used in: 

AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\324\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.measurement_impl' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\306\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.storage.common' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\305\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.sessions' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\328\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.android.gms.stats' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\282\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.auth.internal' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\285\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.components' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\287\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.remoteconfiginterop' used 
in: AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\316\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.android.gms.auth.api.phone' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\317\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.android.gms.base' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\280\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.appcheck.interop' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\284\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.ktx' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\289\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.crashlytics' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\322\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.android.gms.measurement_base' used 
in: AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\278\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.firebase_analytics' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\320\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.android.gms.location' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
master\AmadaApp\obj\Debug\net8.0- 
android\lp\299\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.firebase.iid.internal' used in: 
AndroidManifest.xml, AndroidManifest.xml.
C:\Users\manue\source\repos\AmadaApp- 
 master\AmadaApp\obj\Debug\net8.0- 
 android\lp\327\jl\AndroidManifest.xml Warning:
    Namespace 'com.google.android.gms.safetynet' used in: 
 AndroidManifest.xml, AndroidManifest.xml.

    android:exported needs to be explicitly specified for element 
<service#crc649aaf9c208817d9c3.FirebaseService>. Apps targeting 
Android 12 and higher are required to specify an explicit value 
for `android:exported` when the corresponding component has an 
intent filter defined. See 
https://developer.android.com/guide/topics/manifest/activity- 
element#exported for details.
Directory 'obj\Debug\net8.0-android\lp\277' is from 'firebase- 
abt.aar'.
Directory 'obj\Debug\net8.0-android\lp\315' is from 'play- 
services-ads-identifier.aar'.
Directory 'obj\Debug\net8.0-android\lp\290' is from 'firebase- 
database-collection.aar'.
Directory 'obj\Debug\net8.0-android\lp\300' is from 'firebase- 
installations.aar'.
Directory 'obj\Debug\net8.0-android\lp\288' is from 'firebase- 
core.aar'.
Directory 'obj\Debug\net8.0-android\lp\307' is from 'firebase- 
storage.aar'.
Directory 'obj\Debug\net8.0-android\lp\292' is from 'firebase- 
dynamic-links.aar'.
Directory 'obj\Debug\net8.0-android\lp\297' is from 'firebase- 
functions.aar'.
Directory 'obj\Debug\net8.0-android\lp\325' is from 'play- 
services-measurement-sdk-api.aar'.
Directory 'obj\Debug\net8.0-android\lp\326' is from 'play- 
services-measurement-sdk.aar'.
Directory 'obj\Debug\net8.0-android\lp\291' is from 'firebase- 
datatransport.aar'.
Directory 'obj\Debug\net8.0-android\lp\302' is from 'firebase- 
measurement-connector.aar'.
Directory 'obj\Debug\net8.0-android\lp\298' is from 'firebase- 
iid.aar'.
Directory 'obj\Debug\net8.0-android\lp\283' is from 'firebase- 
common.aar'.
Directory 'obj\Debug\net8.0-android\lp\294' is from 'firebase- 
encoders-json.aar'.
Directory 'obj\Debug\net8.0-android\lp\301' is from 'firebase- 
installations-interop.aar'.
Directory 'obj\Debug\net8.0-android\lp\303' is from 'firebase- 
messaging.aar'.
Directory 'obj\Debug\net8.0-android\lp\319' is from 'play-services-cloud-messaging.aar'.
Directory 'obj\Debug\net8.0-android\lp\296' is from 'firebase-firestore.aar'.
Directory 'obj\Debug\net8.0-android\lp\321' is from 'play-services-measurement-api.aar'.
Directory 'obj\Debug\net8.0-android\lp\304' is from 'protolite-well-known-types.aar'.
Directory 'obj\Debug\net8.0-android\lp\286' is from 'firebase-config.aar'.
Directory 'obj\Debug\net8.0-android\lp\318' is from 'play-services-basement.aar'.
Directory 'obj\Debug\net8.0-android\lp\329' is from 'play-services-tasks.aar'.
Directory 'obj\Debug\net8.0-android\lp\323' is from 'play-services-measurement.aar'.
Directory 'obj\Debug\net8.0-android\lp\281' is from 'firebase-auth.aar'.
Directory 'obj\Debug\net8.0-android\lp\324' is from 'play-services-measurement-impl.aar'.
Directory 'obj\Debug\net8.0-android\lp\306' is from 'firebase-storage-common.aar'.
Directory 'obj\Debug\net8.0-android\lp\305' is from 'firebase-sessions.aar'.
Directory 'obj\Debug\net8.0-android\lp\328' is from 'play-services-stats.aar'.
Directory 'obj\Debug\net8.0-android\lp\282' is from 'firebase-auth-interop.aar'.
Directory 'obj\Debug\net8.0-android\lp\285' is from 'firebase-components.aar'.
Directory 'obj\Debug\net8.0-android\lp\287' is from 'firebase-config-interop.aar'.
Directory 'obj\Debug\net8.0-android\lp\316' is from 'play-services-auth-api-phone.aar'.
Directory 'obj\Debug\net8.0-android\lp\317' is from 'play-services-base.aar'.
Directory 'obj\Debug\net8.0-android\lp\280' is from 'firebase-appcheck-interop.aar'. 
Directory 'obj\Debug\net8.0-android\lp\284' is from 'firebase-common-ktx.aar'.
Directory 'obj\Debug\net8.0-android\lp\289' is from 'firebase-crashlytics.aar'.
Directory 'obj\Debug\net8.0-android\lp\322' is from 'play-services-measurement-base.aar'.
Directory 'obj\Debug\net8.0-android\lp\278' is from 'firebase-analytics.aar'.
Directory 'obj\Debug\net8.0-android\lp\320' is from 'play-services-location.aar'.
Directory 'obj\Debug\net8.0-android\lp\299' is from 'firebase-iid-interop.aar'.
Directory 'obj\Debug\net8.0-android\lp\327' is from 'play-services-safetynet.aar'.  AmadaApp (net8.0-android)   C:\Users\manue\source\repos\AmadaApp-master\AmadaApp\obj\Debug\net8.0-android\AndroidManifest.xml   64  
android error-handling maui
1个回答
0
投票

它似乎在抱怨你在第 49 行和第 70 行设置的意图过滤器。

<action android:name="com.google.android.gms.analytics.CampaignTrackingReceiver" />

我建议您停止收听 ChatGPT 并开始阅读文档和入门指南。

© www.soinside.com 2019 - 2024. All rights reserved.