Eclipse 不生成 MainActivity.java &活动_main.xml [英] Eclipse doesn't generate MainActivity.java & activity_main.xml
问题描述
在创建一个新的Android应用程序项目时,src文件夹&中应自动生成其包名下的MainActivity.java
activity_main.xml
应该在 layout 文件夹中创建.但它没有被创建.
On creating a new Android Application Project, MainActivity.java
under its package name should be generated automatically in src folder & activity_main.xml
should be created inside layout folder. But it is not created.
而且在清单中它也不会生成这个 POC
And also in manifest it doesn`t generate this POC
<activity
android:name="info.androidhive.slidingmenu.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
但是,我手动添加了所有这些内容.
However, I added all these things manually.
activity_main.xml 然后显示这个错误
activity_main.xml then shows this error
Eclipse is loading framework information and the layout library from the SDK folder.
activity_main.xml will refresh automatically once the process is finished.
MainActivity.java 无法识别 setContentView(R.layout.activity_main)
昨天我从 SDK Manager 下载了更新,这些工具已安装/updated
And yesterday I downloalded the updates from SDK Manager these tools are installed /updated
我尝试清理项目,更改工作区,重新启动 eclipse &windows 但它没有帮助:(
I tried cleaning the project,changing the workspace,restarting the eclipse & windows but it doesn't helps :(
推荐答案
正如一个人所说
即使我下载了 Android SDK 并进行了全新安装,我也遇到了同样的问题,但我刚刚解决了它.我尝试单击帮助"->检查更新",然后我收到一条弹出消息,说一切都是最新的,但经过进一步研究,我发现它不是最新的.您需要做的是单击帮助"->安装新软件"并从此网址安装(这将更新它):https://dl-ssl.google.com/android/eclipse/
I had the same problem even though I downloaded the Android SDK and did a clean install, but I just resolved it. I tried to click "Help" -> "Check for updates", and then I got a pop-up message saying everything was up to date, but after further research it appeared to me it wasn't up to date. What you need to do is click "Help" -> "Install new software" and install (this will update it) from this url: https://dl-ssl.google.com/android/eclipse/
见这里线程 https://code.google.com/p/android/issues/detail?id=66647
这篇关于Eclipse 不生成 MainActivity.java &活动_main.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!