在Eclipse编译第一个Android程序的时候报出这样的错误:

setContentView(R.layout.main);  出错。
报告说:As of ADT 14, resource constants in library projects are no longer final.

但是,最终的原因和ADT 14没有什么关系,看下面的帖子:

 

http://stackoverflow.com/questions/6002756/setcontentviewr-layout-main-error

If you fix imports before R.java has been generated for your project (before building it the first time) it will add the line:

import android.R;

which will override the local R.java that you are trying to reference.

Deleting that line resolved the errors for me.

相关文章:

  • 2022-02-17
  • 2021-05-09
  • 2021-11-11
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-07
  • 2022-12-23
  • 2021-12-04
  • 2021-04-28
  • 2021-10-26
  • 2021-05-22
  • 2022-01-30
相关资源
相似解决方案