-1

My AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="eu.amedya.amedyaeu">
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="eu.amedya.amedyaeu.MainActivity"
            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>

    <service
        android:name=".MesajServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <service
        android:name=".IDServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>
</manifest>

Firebase Cloud Messaging and Android WebView project. Error:(14) Error: The element must be a direct child of the element [WrongManifestParent]

Thank you in advance for your help.


Thank you for your reply.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="eu.amedya.amedyaeu">
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="eu.amedya.amedyaeu.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

<service
        android:name=".MesajServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <service
        android:name=".IDServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>
    </application>

4 Answers4

2

Checkout official doc https://developer.android.com/guide/topics/manifest/manifest-intro.html

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="eu.amedya.amedyaeu">
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="eu.amedya.amedyaeu.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

<service
        android:name=".MesajServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <service
        android:name=".IDServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>
    </application>


</manifest>
USKMobility
  • 5,721
  • 2
  • 27
  • 34
0

Replace your mentifest file with these :

   <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="eu.amedya.amedyaeu">
        <uses-permission android:name="android.permission.INTERNET" />
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
            <activity
                android:name="eu.amedya.amedyaeu.MainActivity"
                android:label="@string/app_name">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>

  <service
            android:name=".MesajServisi" >
            <intent-filter>
                <action
                    android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <service
            android:name=".IDServisi" >
            <intent-filter>
                <action
                    android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        </application>


    </manifest>
0
 <service
        android:name=".MesajServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <service
        android:name=".IDServisi" >
        <intent-filter>
            <action
                android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

Put this lines inside your application tag

Happy Coding!!

Mohit Trivedi
  • 699
  • 3
  • 13
0

Put these tag insid your application tag as follows

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="eu.amedya.amedyaeu">
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="eu.amedya.amedyaeu.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name=".MesajServisi" >
            <intent-filter>
                <action
                    android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <service
            android:name=".IDServisi" >
            <intent-filter>
                <action
                    android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
    </application>
</manifest>
Nikhil
  • 3,711
  • 8
  • 32
  • 43