R cannot be resolved android Studio

Asked

Viewed 250 times

0

I’m facing a problem, it seems to be a bit simple, but I’m already a few hours into it.

I’m mounting a project on android Studio and the Same is giving in the field private UserLoginTask mAuthTask = null;

// UI references.
private AutoCompleteTextView mEmailView;
private EditText mPasswordView;
private View mProgressView;
private View mLoginFormView;

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

on the line setContentView(R.layout.activity_login_) R Stays in red and does not compile the project.

I’ve searched several tutorials including what they say to go in Build > Clean and in Rebuild, I also reviewed Project Struture but without success

Would anyone know what that could be Ever since I’m so grateful

  • Place the write cursor next to R, from alt + enter and see if the import option appears, if yes, just click on it and that’s it

  • Now when a new Activity is created, it does not automatically import

1 answer

0

Usually I get this kind of error when there is some error in xml files, check them and then recompile your project.

PS: Eclipse Android does not accept capital letters in XML file names, I’m not sure if android studio has the same procedure, but it’s worth a try.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.