-1

I was making an app in android studio and i had no errors. I closed android studio but reopened it because i forgot to do something. when i went into my MainActivity.java i noticed the R was in red and i don't know why

this is the code in my java, it's not like there was something in it:

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

public class HomeMenu extends AppCompatActivity {

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

}

can someone help me ?

  • http://stackoverflow.com/questions/17421104/android-studio-marks-r-in-red-with-error-message-cannot-resolve-symbol-r-but – Scott May 11 '17 at 16:24
  • 3
    Possible duplicate of [Android Studio marks R in red with error message "cannot resolve symbol R", but build succeeds](http://stackoverflow.com/questions/17421104/android-studio-marks-r-in-red-with-error-message-cannot-resolve-symbol-r-but) – Scott May 11 '17 at 16:24
  • Did you try doing a rebuild? – EJoshuaS - Stand with Ukraine May 11 '17 at 16:50

1 Answers1

0

Ok, this is what I would do:

  • Clean the project
  • Rebuild the project

If that doesn't work, then:

  • Go to: File -> Invalidate Caches and Restart.

And if the previous option didn't work, then:

  • Check the package name in the first lines of the java files.
  • Create a new project and copy the content of your previous project.
Diego Rivera
  • 403
  • 1
  • 5
  • 19