Eclipse不会生成MainActivity.java& activity_main.xml中 [英] Eclipse doesn't generate MainActivity.java & activity_main.xml
问题描述
在创建新的Android应用程序项目时,其包名称下的 MainActivity.java
应在 src 文件夹&应在布局文件夹内创建 activity_main.xml
。但是没有创建。
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 这些工具已安装/更新
And yesterday I downloalded the updates from SDK Manager these tools are installed /updated
我尝试清理项目,更改工作区,重新启动eclipse&窗口,但它没有帮助:(
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 /
看到这里线程 https://code.google.com/p/android/issues/detail?id=66647
这篇关于Eclipse不会生成MainActivity.java& activity_main.xml中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!