简体   繁体   English

Eclipse ADT未生成MainActivity

[英]Eclipse ADT not generating MainActivity

I am having an immensely frustrating issue with Eclipse and the ADT after updating all the SDK's, API's and Support Libraries for Android this week. 在本周更新了适用于Android的所有SDK,API和支持库后,我对Eclipse和ADT感到非常沮丧。

Ever since updating everything I am unable to properly create an Android Project in Eclipse. 自更新所有内容以来,我一直无法在Eclipse中正确创建Android项目。 It does not generate the MainActivity.java or the main_layout.xml files at all. 它根本不会生成MainActivity.java或main_layout.xml文件。 I have read through most of the other posts regarding this and the fixes they suggest don't seem to work. 我已经阅读了大多数其他有关此内容的文章,他们建议的修复措施似乎无效。 I have tried looking for the updated software by going to: 我尝试通过以下方式寻找更新的软件:

Help --> Check for updates (Everything is up-to-date). 帮助->检查更新(一切都是最新的)。

I have also tried the manual way by going to: 我还尝试通过以下方式进行手动操作:

Help --> Install New Software and inputting https://dl-ssl.google.com/android/eclipse/ 帮助->安装新软件并输入https://dl-ssl.google.com/android/eclipse/

It still says I have the latest version of the ADT. 它仍然说我拥有最新版本的ADT。

I have also tried reinstalling the ADT plugin as well, but to not avail. 我也尝试过重新安装ADT插件,但无济于事。

Trying to create an Activity after project creation also does not work. 创建项目后尝试创建活动也无法正常工作。

Versions of software that I am running: 我正在运行的软件版本:

Android SDK Tools 24.0.1 Android SDK工具24.0.1

Android API 1.5 up to and including API 5.0.1 Android API 1.5及以下版本(包括API 5.0.1)

Eclipse: Luna Service Release 1(4.4.1) Eclipse:Luna Service Release 1(4.4.1)

ADT Plugin Not sure ADT插件不确定

Thank you for taking the time to read this. 感谢您抽出时间来阅读。

Add an Empty Activity , instead of Blank Activity. 添加一个空活动 ,而不是空白活动。 This will generate MainActivity.java 这将生成MainActivity.java

What is your Java version? 您的Java版本是什么? You didn't mention about it. 您没有提及它。 Please check it, it should be Java 7 for Android 5.0. 请检查它,它应该是适用于Android 5.0的Java 7。 If you have Java 7 then check eclipse.ini file. 如果您有Java 7,请检查eclipse.ini文件。 If it refers to Java 6 then change here also to Java 7. 如果它指的是Java 6,则在此也更改为Java 7。

The ADT and SDK Tools must be compatible. ADT和SDK工具必须兼容。 The latest ADT version is "ADT 23.0.4". 最新的ADT版本是“ ADT 23.0.4”。 And the corresponding SDK Tools version is 23.0.5. 相应的SDK工具版本为23.0.5。 You have updated your SDK Tools version to 24.0.1, but there are no ADT version can support. 您已经将SDK工具版本更新为24.0.1,但是没有ADT版本可以支持。 So you should roolback to the SDK Tool version 23.0.5. 因此,您应该回滚到SDK工具版本23.0.5。 Here is the link: https://dl-ssl.google.com/android/repository/tools_r23.0.5-windows.zip 这是链接: https : //dl-ssl.google.com/android/repository/tools_r23.0.5-windows.zip

Google fixed this issue and below link may help you. Google已解决此问题,下面的链接可能会帮助您。

https://code.google.com/p/android/issues/detail?id=82393 https://code.google.com/p/android/issues/detail?id=82393

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM