2015-02-12 110 views
1

Im在我的清单文件中出现错误。/AndroidManifest.xml的解析器异常:与元素类型“service”关联的属性名称“**”必须后跟'='字符

/Cheve En Breve App/AndroidManifest.xml的解析器异常:与元素类型“service”关联的属性名称“andrcom.chevenbreve.app.libraries.ServiceNotification”必须后跟'='字符。

似乎无法得到它修复,有什么建议吗?

<?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.chevenbreve.app" 
    android:versionCode="7" 
    android:versionName="2.0" > 

    <uses-sdk 
     android:minSdkVersion="11" 
     android:targetSdkVersion="21" /> 

    <uses-permission android:name="android.permission.INTERNET"/> 

     <!-- GCM requires a Google account. --> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 

    <!-- Keeps the processor from sleeping when a message is received. --> 
    <uses-permission android:name="android.permission.WAKE_LOCK" /> 

    <!-- This app has permission to register and receive data message. --> 
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 

    <!-- Creates a custom permission so only this app can receive its messages. --> 
    <permission 
     android:name="com.chevenbreve.app.permission.C2D_MESSAGE" 
     android:protectionLevel="signature" /> 

    <uses-permission android:name="com.chevenbreve.app.permission.C2D_MESSAGE" /> 

     <!-- Permission to vibrate --> 
    <uses-permission android:name="android.permission.VIBRATE" /> 

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 
    <!-- External storage for caching. --> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
    <!-- My Location --> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 

    <!-- change com.pongodev.perkututapp with your own package name --> 
    <permission 
     android:name="com.chevenbreve.app.permission.MAPS_RECEIVE" 
     android:protectionLevel="signature"/> 
    <uses-permission android:name="com.chevenbreve.app.permission.MAPS_RECEIVE"/> 

    <!-- Maps API needs OpenGL ES 2.0. --> 
    <uses-feature 
     android:glEsVersion="0x00020000" 
     android:required="true"/> 
    <!-- End of copy. --> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_share" 
     android:label="@string/app_name" 
     android:logo="@drawable/logo" 
     android:theme="@style/Theme.Apptheme" > 

     <!-- Admob --> 
     <meta-data 
      android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version"/> 

     <!-- You must insert your own Google Maps for Android API v2 key in here. --> 
     <meta-data 
     android:name="com.google.android.maps.v2.API_KEY" 
     android:value="AIzaSyC29XS3jhhrZGOh3wdSN5iDZeRELhavI4E"/> 

     <meta-data 
     android:name="com.google.android.gms.version" 
     android:value="@integer/google_play_services_version"/> 


     <activity 
      android:name="com.chevenbreve.app.ActivitySplash" 
      android:label="@string/app_name" 
      android:theme="@style/Theme.Apptheme.NoActionBar" 
      android:noHistory="true" 
      android:screenOrientation="portrait" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name="com.chevenbreve.app.ActivityHome" 
      android:screenOrientation="portrait" 
      android:label="@string/app_name" > 

      <meta-data android:name="android.app.default_searchable" 
       android:value="com.chevenbreve.app.ActivitySearch" /> 

     </activity> 

     <activity 
      android:name="com.chevenbreve.app.ActivitySearch" 
      android:screenOrientation="portrait"> 
      <intent-filter > 
       <action android:name="android.intent.action.SEARCH"/> 
      </intent-filter> 

      <meta-data 
       android:name="android.app.searchable" 
       android:resource="@xml/searchable"/> 
     </activity> 

     <activity 
      android:name="com.chevenbreve.app.ActivityPlaceAroundYou" 
      android:screenOrientation="portrait" 
      android:label="@string/page_around_you" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityCategory" 
      android:screenOrientation="portrait" 
      android:label="@string/page_category" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityPlaceList" 
      android:screenOrientation="portrait" 
      android:label="@string/page_place_list" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityDetailPlace" 
      android:screenOrientation="portrait" 
      android:label="@string/page_detail_place" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivitySetting" 
      android:screenOrientation="portrait" 
      android:label="@string/page_setting" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityShare" 
      android:label="@string/page_share" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityAbout" 
      android:label="@string/page_about" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityDirection" 
      android:label="@string/direction" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityBrowser" 
      android:screenOrientation="portrait" 
      android:label="@string/app_name" 
      android:uiOptions="splitActionBarWhenNarrow" > 
      <meta-data android:name="android.support.UI_OPTIONS" 
        android:value="splitActionBarWhenNarrow" /> 
     </activity> 

     <activity android:name="com.facebook.LoginActivity" 
      android:theme="@android:style/Theme.Translucent.NoTitleBar" 
      android:label="@string/app_name" /> 
     <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> 

     <provider android:name="com.chevenbreve.app.libraries.SuggestionProvider" com.chevenbreve.app.libraries.SuggestionProviderrities="com.chevenbreve.app.libraries.SuggestionProvider"/> 

     <activity android:name="com.google.android.gms.ads.AdActivity" 
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> 
     <service android:name="com.chevenbreve.app.libraries.ServiceNotification" andrcom.chevenbreve.app.libraries.ServiceNotification 
      android:name="com.google.android.gcm.GCMBroadcastReceiver" 
      android:permission="com.google.android.c2dm.permission.SEND" > 
      <intent-filter> 

       <!-- Receives the actual messages. --> 
       <action android:name="com.google.android.c2dm.intent.RECEIVE" /> 
       <!-- Receives the registration id. --> 
       <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> 

       <category android:name="com.chevenbreve.app" /> 
      </intent-filter> 
     </receiver> 

     <service android:name="com.chevenbreve.app.GCMIntentService"/> 

    </application> 

</manifest> 
+0

你得在'<服务的Android双类型:NAME =” com.chevenbreve.app.libraries.ServiceNotification“andrcom.chevenbreve.app.libraries.ServiceNotification' – 2015-02-12 03:21:31

回答

0

你的manifest.xml包含一些明显的错误,我已经改正它适合你,使用下面的代码来代替:

<?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.chevenbreve.app" 
    android:versionCode="7" 
    android:versionName="2.0" > 

    <uses-sdk 
     android:minSdkVersion="11" 
     android:targetSdkVersion="21" /> 

    <uses-permission android:name="android.permission.INTERNET"/> 

     <!-- GCM requires a Google account. --> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 

    <!-- Keeps the processor from sleeping when a message is received. --> 
    <uses-permission android:name="android.permission.WAKE_LOCK" /> 

    <!-- This app has permission to register and receive data message. --> 
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 

    <!-- Creates a custom permission so only this app can receive its messages. --> 
    <permission 
     android:name="com.chevenbreve.app.permission.C2D_MESSAGE" 
     android:protectionLevel="signature" /> 

    <uses-permission android:name="com.chevenbreve.app.permission.C2D_MESSAGE" /> 

     <!-- Permission to vibrate --> 
    <uses-permission android:name="android.permission.VIBRATE" /> 

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 
    <!-- External storage for caching. --> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
    <!-- My Location --> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 

    <!-- change com.pongodev.perkututapp with your own package name --> 
    <permission 
     android:name="com.chevenbreve.app.permission.MAPS_RECEIVE" 
     android:protectionLevel="signature"/> 
    <uses-permission android:name="com.chevenbreve.app.permission.MAPS_RECEIVE"/> 

    <!-- Maps API needs OpenGL ES 2.0. --> 
    <uses-feature 
     android:glEsVersion="0x00020000" 
     android:required="true"/> 
    <!-- End of copy. --> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_share" 
     android:label="@string/app_name" 
     android:logo="@drawable/logo" 
     android:theme="@style/Theme.Apptheme" > 

     <!-- Admob --> 
     <meta-data 
      android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version"/> 

     <!-- You must insert your own Google Maps for Android API v2 key in here. --> 
     <meta-data 
     android:name="com.google.android.maps.v2.API_KEY" 
     android:value="AIzaSyC29XS3jhhrZGOh3wdSN5iDZeRELhavI4E"/> 

     <meta-data 
     android:name="com.google.android.gms.version" 
     android:value="@integer/google_play_services_version"/> 


     <activity 
      android:name="com.chevenbreve.app.ActivitySplash" 
      android:label="@string/app_name" 
      android:theme="@style/Theme.Apptheme.NoActionBar" 
      android:noHistory="true" 
      android:screenOrientation="portrait" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name="com.chevenbreve.app.ActivityHome" 
      android:screenOrientation="portrait" 
      android:label="@string/app_name" > 

      <meta-data android:name="android.app.default_searchable" 
       android:value="com.chevenbreve.app.ActivitySearch" /> 

     </activity> 

     <activity 
      android:name="com.chevenbreve.app.ActivitySearch" 
      android:screenOrientation="portrait"> 
      <intent-filter > 
       <action android:name="android.intent.action.SEARCH"/> 
      </intent-filter> 

      <meta-data 
       android:name="android.app.searchable" 
       android:resource="@xml/searchable"/> 
     </activity> 

     <activity 
      android:name="com.chevenbreve.app.ActivityPlaceAroundYou" 
      android:screenOrientation="portrait" 
      android:label="@string/page_around_you" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityCategory" 
      android:screenOrientation="portrait" 
      android:label="@string/page_category" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityPlaceList" 
      android:screenOrientation="portrait" 
      android:label="@string/page_place_list" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityDetailPlace" 
      android:screenOrientation="portrait" 
      android:label="@string/page_detail_place" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivitySetting" 
      android:screenOrientation="portrait" 
      android:label="@string/page_setting" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityShare" 
      android:label="@string/page_share" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityAbout" 
      android:label="@string/page_about" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityDirection" 
      android:label="@string/direction" /> 

     <activity 
      android:name="com.chevenbreve.app.ActivityBrowser" 
      android:screenOrientation="portrait" 
      android:label="@string/app_name" 
      android:uiOptions="splitActionBarWhenNarrow" > 
      <meta-data android:name="android.support.UI_OPTIONS" 
        android:value="splitActionBarWhenNarrow" /> 
     </activity> 

     <activity android:name="com.facebook.LoginActivity" 
      android:theme="@android:style/Theme.Translucent.NoTitleBar" 
      android:label="@string/app_name" /> 
     <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> 

     <provider android:name="com.chevenbreve.app.libraries.SuggestionProvider" android:authorities="com.chevenbreve.app.libraries.SuggestionProvider"/> 

     <activity android:name="com.google.android.gms.ads.AdActivity" 
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> 
     <service android:name="com.chevenbreve.app.libraries.ServiceNotification" 
      android:permission="com.google.android.c2dm.permission.SEND" > 
      <intent-filter> 

       <!-- Receives the actual messages. --> 
       <action android:name="com.google.android.c2dm.intent.RECEIVE" /> 
       <!-- Receives the registration id. --> 
       <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> 

       <category android:name="com.chevenbreve.app" /> 
      </intent-filter> 
     </service> 

     <service android:name="com.chevenbreve.app.GCMIntentService"/> 

    </application> 

</manifest> 
+0

更改了代码建议,但现在我得到这个错误: com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser例外/ Users/TheGraphicAsylum/Documents/workspace/Perkutut V 1.2.1/Projects/Perkutut V.1.2.1/Andro idManifest.xml:绑定到名称空间的属性“name”已经为元素“service”指定了“http://schemas.android.com/apk/res/android”。 – GraphicAsylum 2015-02-14 03:25:30

+0

@GraphicAsylum这是因为你的服务包含两个“名称”属性。代码已更正。 – 2015-02-25 02:18:40

相关问题