Search code examples
androidandroid-activityandroid-manifest

Unresolved class MainActivity - AndroidManifest.xml


I have an Error in my AndroidManifest.xml I don't know why but it's just here...

This is AndroidManifest.xml:

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

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

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

</manifest>

So basically my Main Activity is pretty empty, and I don't know why this Appears here: C My main activity:

package packagename;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

here is the image:
here is the image


Solution

  • It's just a false error. Sometimes Android Studio goes mad. Just Restart the Android Studio and Open Project Again. It will solve the problem. If not restart your pc.