2015-10-14 35 views
2

我做Android Studio中一個新的項目,這是我的清單文件:元素不是這裏的Android清單文件允許

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

    <application 
     android:allowBackup="false" 
     android:icon="@drawable/icon" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme" > 
     <activity android:name=".rajcica" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

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

</manifest> 

當我建立我的文件,我得到幾個gradle這個錯誤,我得到這個調試/ manifest文件打開:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="cro.perger.rajcica" 
    android:versionCode="10" 
    android:versionName="2.0.1" > 

    <uses-sdk 
     android:minSdkVersion="16" 
     android:targetSdkVersion="23" /> 

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

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

</manifest> 

我得到這個錯誤:

  • URI未註冊
  • 元素不允許(的versionCode,的versionName,圖標,allowBackup,主題,supportsRtl)

不知道如何解決這個問題,因爲許多這樣的屬性是從我的清單文件中刪除,而不是從調試/ manifest文件:(

請幫

+0

可能的重複:http://stackoverflow.com/questions/20569610/why-am-i-getting-error-message-uri-is-not-registered – Tali

+0

不知道這是否重複,我問的是如何從調試清單文件中刪除錯誤,因爲我從主清單文件中刪除了thoose行? – Goran

回答

1

如果您刪除從清單這些行,但他們仍然在你的調試,那麼它聽起來像你的清單是在錯誤的文件夾中。可能你的目錄結構發生了一些變化,你並沒有意識到或意圖發生這種情況。

獲取正確文件夾中的清單並確保您正在編輯正確的文件夾。

看到這個相關的帖子:Why is Android Studio reporting "URI is not registered"?

它也可能是您正在設置他們在您的build.gradle文件 - 檢查那裏。

相關問題