2012-10-02 20 views
1

我做了使用Eclipse新項目Android應用開發 - 基地項目包含錯誤

整個src文件夾包含@Override錯誤,我可以解決(API等級14,BlankActivity,標籤+刷卡)。 然而,AndroidManifest.xml文件顯示錯誤:

The markup in the document following the root element must be well-formed. 

我該如何解決這個問題?

這裏是不變的,默認的xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.sohamchowdhury.ferric" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="14" 
     android:targetSdkVersion="15" /> 

    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
    </application> 

</manifest><manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.sohamchowdhury.ferric" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="14" 
     android:targetSdkVersion="15" /> 

    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".AspectListActivity" 
      android:label="@string/title_aspect_list" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".AspectDetailActivity" 
      android:label="@string/title_aspect_detail" > 
      <meta-data 
       android:name="android.support.PARENT_ACTIVITY" 
       android:value=".AspectListActivity" /> 
     </activity> 
    </application> 

</manifest><manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.sohamchowdhury.ferric" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="15" /> 

    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".MainActivity" 
      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> 
+1

你有太多的'manifests' .. – Aprian

回答

1

你有你的XML文件中不止一個明顯的標籤。 從您的代碼中刪除以下部分。

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.sohamchowdhury.ferric" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="14" 
     android:targetSdkVersion="15" /> 

    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
    </application> 

</manifest> 

並確保您有XML聲明出現在您的manifest.xml文件的第一行。

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

爲什麼Eclipse中產生的錯誤_default_代碼? –

+0

我不知道背後的確切原因。這個問題不在API 13中。我猜有時候eclipse無法解決並正確加載新創建的項目。 –

+0

如果解決了您的問題,請接受答案。它增加了雙方的聲譽。 –

相關問題