Android tutorial error: R cannot be resolved to a variable

前端 未结 12 594
野性不改
野性不改 2020-12-11 20:35

http://developer.android.com/training/basics/firstapp/building-ui.html

I have been following this tutorial, but I have two errors, both \"R cannot be resolved to a v

12条回答
  •  死守一世寂寞
    2020-12-11 20:58

    You have to make sure to

    1. Clean your project Project-->Clean
    2. The /res directory doesn't contain errors (some files will show up with a red icon on the file explorer)
    3. Your imports doesn't contain this line import android.R;
    4. Check that in AndroidManifest.xml, the attribute package has the correct value.

提交回复
热议问题