如何调试"解析XML时出错:标签不匹配"?

时间:2017-09-22 06:42:58

标签: java android xml

我已经关闭了标签,但它仍然给我错误,当我编译它时说:

  

解析XML时出错:标记不匹配

在XML Copy Editor中,当我在标签PreferenceScreen第2行"中保存"数据的过早结束时,它会告诉我,请有人能像我应该写的那样给我写代码吗?,事实我不知道我做错了什么,我是初学者。

    <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/GB_Mods"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:cmwmobile="http://schemas.android.com/apk/res/com.whatsapp">
    <PreferenceCategory android:title="HPWhatsApp 4.0" android:key="cat_wa">
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_preguntas" android:title="HPWhatsApp WEB" android:key="settings_faq" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_actualizaciones" android:title="@string/updatess" android:key="updates_key" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_Thanks" android:title="Donar" android:summary="Donar al desarrollador" >
            <intent android:action="android.intent.action.VIEW" android:data="https://paypal.me/Hectorc4rp" />
         </com.whatsapp.preference.WaPreference>
        <PreferenceScreen android:icon="@drawable/ic_9" android:title="Contactar al desarrollador" android:summary="Habla con Héctor Paez, creador de HPWhatsApp" >
            <intent android:action="android.intent.action.VIEW" android:data="https://api.whatsapp.com/send?phone=543814805749" />
        </PreferenceScreen>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/themes">
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_descargar" android:title="@string/download_themes" android:key="download_themes" android:summary="@string/download_themes_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_temas" android:title="@string/more_preferences" android:key="themes_key" android:summary="@string/more_preferences_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_web" android:title="Más temas" android:summary="Descarga temas hechos por otras personas" >
             <intent android:action="android.intent.action.VIEW" android:data="http://www.whatsappthemes.net/search/label/GBWhatsApp%20Themes" />
        </com.whatsapp.preference.WaPreference>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/appearance">
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_1" android:title="@string/conversation_colors" android:key="chat_colors" android:summary="@string/conversation_colors_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_2" android:title="@string/chats_colors" android:key="chats_colors" android:summary="@string/chats_colors_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_3" android:title="@string/popup_colors" android:key="popup_key" android:summary="@string/popup_colors_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_4" android:title="@string/widgets" android:key="widget_key" android:summary="@string/widgets_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_5" android:title="@string/media_sharing_pref" android:key="media_sharing_key" android:summary="@string/media_sharing_pref_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_6" android:title="@string/others" android:key="others_key" android:summary="@string/others_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_7" android:title="@string/gb_lock" android:key="gb_lock" />
        <Preference android:icon="@drawable/ic_actualizaciones" android:title="@string/clean_whatsapp_pref" android:key="clean_whatsapp_screen" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_8" android:title="@string/read_log_pref" android:key="logs_key" />
        <ListPreference android:icon="@drawable/ic_lang" android:entries="@array/language_array" android:title="@string/language_title" android:key="gb_language_key" android:defaultValue="0" android:entryValues="@array/language_values" />
        <Preference android:icon="@drawable/ic_temas" android:title="@string/change_font_pref" android:key="gb_fonts" />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/GB_About" android:key="cat_about">
        <Preference android:icon="@drawable/ic_twitter" android:title="@string/pref_facebook" android:key="facebook" android:summary="@string/pref_sum_facebook" />
        <Preference android:icon="@drawable/ic_twi" android:title="@string/google_plus" android:key="google_plus" android:summary="@string/google_plus_sum" />
        <Preference android:icon="@drawable/ic_web" android:title="@string/pref_sum_blogger" android:key="about" android:summary="HPWhatsApp" />
        <Preference android:icon="@drawable/ic_twitter" android:title="Página de Facebook" android:summary="Regalanos un me gusta en Facebook" >
              <intent android:action="android.intent.action.VIEW" android:data="https://facebook.com/todo.para.android.hp" />
        <Preference android:icon="@drawable/ic_compartir" android:title="@string/GBShare" android:key="share" android:summary="@string/GBShareSum" />
        <Preference android:icon="@drawable/ic_reportar" android:title="@string/GB_Report" android:key="report" />
        <Preference android:icon="@drawable/ic_Thanks" android:title="@string/Thanks" android:key="Thanks" />
    </PreferenceCategory>
</PreferenceScreen>

2 个答案:

答案 0 :(得分:1)

您忘了在两个地方关闭“ com.whatsapp.preference.WaPreference ”标记。

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/GB_Mods"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:cmwmobile="http://schemas.android.com/apk/res/com.whatsapp">
    <PreferenceCategory android:title="HPWhatsApp 4.0" android:key="cat_wa">
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_preguntas" android:title="HPWhatsApp WEB" android:key="settings_faq" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_actualizaciones" android:title="@string/updatess" android:key="updates_key" />

        <!-- start <com.whatsapp.preference.WaPreference> -->

        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_Thanks" android:title="Donar" android:summary="Donar al desarrollador" >
            <intent android:action="android.intent.action.VIEW" android:data="https://paypal.me/Hectorc4rp" />

        <!-- close your </com.whatsapp.preference.WaPreference> here -->

        </com.whatsapp.preference.WaPreference>
        <PreferenceScreen android:icon="@drawable/ic_9" android:title="Contactar al desarrollador" android:summary="Habla con Héctor Paez, creador de HPWhatsApp" >
            <intent android:action="android.intent.action.VIEW" android:data="https://api.whatsapp.com/send?phone=543814805749" />
        </PreferenceScreen>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/themes">
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_descargar" android:title="@string/download_themes" android:key="download_themes" android:summary="@string/download_themes_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_temas" android:title="@string/more_preferences" android:key="themes_key" android:summary="@string/more_preferences_summary" />

        <!-- start <com.whatsapp.preference.WaPreference> -->

        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_web" android:title="Más temas" android:summary="Descarga temas hechos por otras personas" >
             <intent android:action="android.intent.action.VIEW" android:data="http://www.whatsappthemes.net/search/label/GBWhatsApp%20Themes" />

         <!-- close your </com.whatsapp.preference.WaPreference> here -->

        </com.whatsapp.preference.WaPreference>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/appearance">
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_1" android:title="@string/conversation_colors" android:key="chat_colors" android:summary="@string/conversation_colors_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_2" android:title="@string/chats_colors" android:key="chats_colors" android:summary="@string/chats_colors_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_3" android:title="@string/popup_colors" android:key="popup_key" android:summary="@string/popup_colors_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_4" android:title="@string/widgets" android:key="widget_key" android:summary="@string/widgets_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_5" android:title="@string/media_sharing_pref" android:key="media_sharing_key" android:summary="@string/media_sharing_pref_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_6" android:title="@string/others" android:key="others_key" android:summary="@string/others_summary" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_7" android:title="@string/gb_lock" android:key="gb_lock" />
        <Preference android:icon="@drawable/ic_actualizaciones" android:title="@string/clean_whatsapp_pref" android:key="clean_whatsapp_screen" />
        <com.whatsapp.preference.WaPreference android:icon="@drawable/ic_8" android:title="@string/read_log_pref" android:key="logs_key" />
        <ListPreference android:icon="@drawable/ic_lang" android:entries="@array/language_array" android:title="@string/language_title" android:key="gb_language_key" android:defaultValue="0" android:entryValues="@array/language_values" />
        <Preference android:icon="@drawable/ic_temas" android:title="@string/change_font_pref" android:key="gb_fonts" />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/GB_About" android:key="cat_about">
        <Preference android:icon="@drawable/ic_twitter" android:title="@string/pref_facebook" android:key="facebook" android:summary="@string/pref_sum_facebook" />
        <Preference android:icon="@drawable/ic_twi" android:title="@string/google_plus" android:key="google_plus" android:summary="@string/google_plus_sum" />
        <Preference android:icon="@drawable/ic_web" android:title="@string/pref_sum_blogger" android:key="about" android:summary="HPWhatsApp" />
        <Preference android:icon="@drawable/ic_twitter" android:title="Página de Facebook" android:summary="Regalanos un me gusta en Facebook" >
              <intent android:action="android.intent.action.VIEW" android:data="https://facebook.com/todo.para.android.hp" />
        <Preference android:icon="@drawable/ic_compartir" android:title="@string/GBShare" android:key="share" android:summary="@string/GBShareSum" />
        <Preference android:icon="@drawable/ic_reportar" android:title="@string/GB_Report" android:key="report" />
        <Preference android:icon="@drawable/ic_Thanks" android:title="@string/Thanks" android:key="Thanks" />
    </PreferenceCategory>
</PreferenceScreen>

答案 1 :(得分:0)

内部com.whatsapp.preference.WaPreference的{​​{1}}标记未关闭。 E.g。

intent