Cannot resolve symbol activity_splash

Pooja :

enter image description hereI created a new Activity called SplaceActivity But setContentView(R.layout.activity_splash); give error that cannot resolve symbol activity_splash. I also try to delete the .xml file and created new but getting the same error. Also, clean the project but getting the same error.

SplashActivity.java

package com.example.tournament;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class SplashActivity extends AppCompatActivity {

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

activity_splash.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

</android.support.constraint.ConstraintLayout>

Can someone plz tell me what is the error.

Thanks in advance.

Nilesh B :

Try File > Invalidate Caches / Restart, seems like bug in Android Studio but sometime copy-paste layout file makes this type of issues.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=410021&siteId=1