2017-11-30 1 views
-1

Ich habe einen seltsamen Fehler und ich kann damit nicht umgehen. Und warum haben alle Zeilen einen seltsamen Fehler? Es begann plötzlich, warum ist das passiert?Fehler: (26) Fehler: Unbekanntes Element <Intent-Filter> gefunden

dies mein Manifast:

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

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

<application 
    android:allowBackup="true" 
    android:debuggable="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:testOnly="true" 
    android:theme="@style/AppTheme" > 
    <activity android:name="budgetreport.com.budgetreport.MainActivity" > 
     <intent-filter> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 

    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 

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

    <meta-data 
     android:name="android.support.VERSION" 
     android:value="26.1.0" /> 
    <meta-data 
     android:name="android.arch.lifecycle.VERSION" 
     android:value="27.0.0-SNAPSHOT" /> 

    <provider 
     android:name="com.android.tools.ir.server.InstantRunContentProvider" 
     android:authorities="budgetreport.com.budgetreport.com.android.tools.ir.server.InstantRunContentProvider" 
     android:multiprocess="true" /> 
</application> 

</manifest> 

Diese Der Fehler: enter image description here

Und warum alle Linien haben einen seltsamen Fehler entdeckt? enter image description here

Antwort

0

Wenn Sie MainActivity als lanuch lassen wollen eingefügt werden, können Sie dies auf die hinzufügen sollten Activity Tag .Es wurde nicht in der application Tag direkt verwendet.

<intent-filter> 
    <action android:name="android.intent.action.MAIN"/> 

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

Versuchen Sie dies in Ihrem Code.

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

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

<application 
    android:allowBackup="true" 
    android:debuggable="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:testOnly="true" 
    android:theme="@style/AppTheme"> 
    <activity android:name="budgetreport.com.budgetreport.MainActivity"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN"/> 

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

    <meta-data 
     android:name="android.support.VERSION" 
     android:value="26.1.0"/> 
    <meta-data 
     android:name="android.arch.lifecycle.VERSION" 
     android:value="27.0.0-SNAPSHOT"/> 

    <provider 
     android:name="com.android.tools.ir.server.InstantRunContentProvider" 
     android:authorities="budgetreport.com.budgetreport.com.android.tools.ir.server.InstantRunContentProvider" 
     android:multiprocess="true"/> 
</application> 
</manifest> 
+0

es Dose'nt Arbeit ... gleichen Fehler @KeLiuyue –

+0

Sie sollten Ihren Code entfernen. Und meinen Code verwenden. – KeLiuyue

0

Verschieben dieser Block:

<intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 

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

Dieser Block sollte zwischen <activity> und </activity> Ihrer MainActivity TAG

+0

Ich verstehe nicht, wo das? @dany poplawec –

Verwandte Themen