-1

私の 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 と Android WebView プロジェクト。エラー:(14) エラー: 要素は要素 [WrongManifestParent] の直接の子でなければなりません

よろしくお願いいたします。


お返事ありがとうございます。

<?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

4 に答える 4

2

公式ドキュメントをチェックアウト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>
于 2016-10-01T10:09:01.493 に答える
0

あなたのmentifestファイルをこれらに置き換えてください:

   <?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>
于 2016-10-01T10:09:06.590 に答える
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>

この行をアプリケーションタグの中に入れてください

ハッピーコーディング!!

于 2016-10-01T10:09:12.593 に答える
0

これらのタグapplicationを次のようにタグ内に配置します

<?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>
于 2016-10-01T10:09:20.810 に答える