Android tutorial error: R cannot be resolved to a variable

前端 未结 12 591
野性不改
野性不改 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 21:10

    This fixed it for me: https://stackoverflow.com/a/3259974/1538785

    Seems like eclipse likes to add an import line to java files for no reason. Go onto your java file, hit ctrl+shift+o and all the import statements will appear. Delete the line that says import andriod.R

提交回复
热议问题