Eclipse Juno/Android broken, the debug is wrong and gen folder not created (R error)

匿名 (未验证) 提交于 2019-12-03 01:01:02

问题:

I have a very very strange issue, and i believe my elcipse juno is broken. I have the Android ADT plugin in this eclipse.

The following screenshot will prove my believe.

And its not finished yet. After the screenshot above, i press F6 again, and this is what i got :

I will explain this case once again to make a clear question. I debug my application, then i got that the arg2 value is 1. After that, i press f6 and the code goes to case 0 (instead of case 1) and then i press f6 again and the code goes to case 6 (WTF????? i do have a break, how come it comes to case 0 and case 6?)

In case you need it, this is the code in the above screenshots :

public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {         // TODO Auto-generated method stub         Intent i = new Intent(this, Chapter.class);          switch(arg2)         {         case 0:             Toast.makeText(this, "a", Toast.LENGTH_SHORT).show();             break;         case 1:             i.putExtra("key", 1);             Toast.makeText(this, arg2 , Toast.LENGTH_SHORT).show();             startActivity(i);             break;         case 2:             i.putExtra("key", 2);             startActivity(i);             break;         case 3:             i.putExtra("key", 3);             startActivity(i);             break;         case 4:             i.putExtra("key", 4);             startActivity(i);             break;         case 5:             i.putExtra("key", 5);             startActivity(i);             break;         case 6:             i.putExtra("key", 6);             startActivity(i);             break;         case 7:             i.putExtra("key", 7);             startActivity(i);             break;         case 8:             i.putExtra("key", 8);             startActivity(i);             break;         }     } 

Thank you very much, and any help is appreciated.

回答1:

I could be completely wrong, but this seems normal to me. The cases work like arrays where the first instance is 0 where your arg2 is an int so the first instance is 1



回答2:

YES, it is broken because of the bug in ADT 22. I need to upgrade the ADT to latest version and install Android Build Tools. After that, the program and the debugging runs NORMALLY.

Those are the links that may help you if you encounter a same problem with me :

https://groups.google.com/forum/?fromgroups#!topic/android-developers/rCaeT3qckoE https://groups.google.com/forum/?fromgroups=#!topic/adt-dev/epOfZbKPFdk



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!