2016-07-08 22 views
0

Google Playに配信するように署名したアプリを作成しようとしたときに問題が発生しました。Androidマニフェストのエラー

Error:(22) Error: The <receiver> element must be a direct child of the <application> element [WrongManifestParent] 

とマニフェスト:

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

    <!-- Permisos --> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

    <!-- Optional permission for reliable local dispatching on non-Google Play devices --> 
    <uses-permission android:name="android.permission.WAKE_LOCK" /> 

    <!-- Add the following meta-data for devices running Google Play service. --> 
    <meta-data 
     android:name="com.google.android.gms.version" 
     android:value="@integer/google_play_services_version" /> 

    <!-- 
     Optionally, register AnalyticsReceiver and AnalyticsService to support background 
     dispatching on non-Google Play devices 
    --> 
    <receiver 
     android:name="com.google.android.gms.analytics.AnalyticsReceiver" 
     android:enabled="true"> 
     <intent-filter> 
      <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" /> 
     </intent-filter> 
    </receiver> 

    <service 
     android:name="com.google.android.gms.analytics.AnalyticsService" 
     android:enabled="true" 
     android:exported="false" /> 

    <!-- 
     Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable 
     installation campaign reporting 
    --> 
    <receiver 
     android:name="com.google.android.gms.analytics.CampaignTrackingReceiver" 
     android:exported="true"> 
     <intent-filter> 
      <action android:name="com.android.vending.INSTALL_REFERRER" /> 
     </intent-filter> 
    </receiver> 

    <service android:name="com.google.android.gms.analytics.CampaignTrackingService" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme"> 
     <activity 
      android:name=".ViveUnaExperiencia" 
      android:label="@string/title_activity_main"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

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

    </application> 

</manifest> 

私はこれを引き起こしているかわからないんだけどここでエラーです。どんな助けもありがとうございます。 Manifestファイル構造に従ってください

+0

受信機は、アプリケーションタグ内に受信し、サービスタグをつけ –

+0

内にある必要があります

<!-- Permisos --> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <!-- Optional permission for reliable local dispatching on non-Google Play devices --> <uses-permission android:name="android.permission.WAKE_LOCK"/> <!-- Add the following meta-data for devices running Google Play service. --> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> <activity android:name=".ViveUnaExperiencia" android:label="@string/title_activity_main"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <service android:name="com.google.android.gms.analytics.AnalyticsService" android:enabled="true" android:exported="false"/> <service android:name="com.google.android.gms.analytics.CampaignTrackingService"/> <!-- Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable installation campaign reporting --> <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER"/> </intent-filter> </receiver> <!-- Optionally, register AnalyticsReceiver and AnalyticsService to support background dispatching on non-Google Play devices --> <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver" android:enabled="true"> <intent-filter> <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH"/> </intent-filter> </receiver> </application> 

SripadRaj

+0

エラーの説明は、すべての必要な情報を:)が含まれています。受信機、サービスタグをアプリケーションタグに配置するだけです。 – comrade

答えて

1

......この

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

     <!-- Permisos --> 
     <uses-permission android:name="android.permission.INTERNET" /> 
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

     <!-- Optional permission for reliable local dispatching on non-Google Play devices --> 
     <uses-permission android:name="android.permission.WAKE_LOCK" /> 



     <application 
      android:allowBackup="true" 
      android:icon="@mipmap/ic_launcher" 
      android:label="@string/app_name" 
      android:theme="@style/AppTheme"> 
      <activity 
       android:name=".ViveUnaExperiencia" 
       android:label="@string/title_activity_main"> 
       <intent-filter> 
        <action android:name="android.intent.action.MAIN" /> 

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


    <!-- Add the following meta-data for devices running Google Play service. --> 
     <meta-data 
      android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version" /> 

     <!-- 
      Optionally, register AnalyticsReceiver and AnalyticsService to support background 
      dispatching on non-Google Play devices 
     --> 
     <receiver 
      android:name="com.google.android.gms.analytics.AnalyticsReceiver" 
      android:enabled="true"> 
      <intent-filter> 
       <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" /> 
      </intent-filter> 
     </receiver> 

     <service 
      android:name="com.google.android.gms.analytics.AnalyticsService" 
      android:enabled="true" 
      android:exported="false" /> 

     <!-- 
      Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable 
      installation campaign reporting 
     --> 
     <receiver 
      android:name="com.google.android.gms.analytics.CampaignTrackingReceiver" 
      android:exported="true"> 
      <intent-filter> 
       <action android:name="com.android.vending.INSTALL_REFERRER" /> 
      </intent-filter> 
     </receiver> 

     <service android:name="com.google.android.gms.analytics.CampaignTrackingService" /> 

     </application> 

    </manifest> 

が............

1

あなたの受信機とサービスをコーディング楽しむ

使用要素は、アプリケーションの要素である必要があり、これは動作するはずです:

<?xml version="1.0" encoding="utf-8"?> 

タグは、アプリケーションタグ
関連する問題