简体   繁体   English

使用Eclipse创建新的android项目后,Eclipse中的SRC文件夹为空(未创建MainActivity类)

[英]SRC folder in Eclipse is empty (MainActivity class not created) after creating a new android project using Eclipse

SRC folder in Eclipse is empty (MainActivity class not created) after creating a new android project using Eclipse- 使用Eclipse创建新的Android项目后,Eclipse中的SRC文件夹为空(未创建MainActivity类)

I created a new android project using Eclipse. 我使用Eclipse创建了一个新的android项目。 But I am seeing SRC folder is empty in the project explorer. 但是我看到SRC文件夹在项目浏览器中为空。 But as per my understanding it should create few .java files automatically like MainActivity.java. 但是据我了解,它应该像MainActivity.java这样自动创建几个.java文件。

I had this problem for the longest time. 我有这个问题的时间最长。 When creating the android application, use "empty activity" instead of "blank" activity. 创建android应用程序时,请使用“空活动”而不是“空白”活动。 Fixed the problem for me immediately. 立即为我解决了问题。

Hope this helps :) 希望这可以帮助 :)

Go to following: 转到以下:
'Help'->'Install New Software' and type https://dl-ssl.google.com/android/eclipse/ '帮助'->'安装新软件',然后输入https://dl-ssl.google.com/android/eclipse/

Select ADT option and install it. 选择ADT选项并安装它。 It will update the ADT. 它将更新ADT。

Even I had the same problem and my issue got resolved with it!! 即使我遇到了同样的问题,我的问题也得到解决!

After entering the Application Name, Project name, etc in the New Android Application window, the next window shown is this : 在“ 新建Android应用程序”窗口中输入应用程序名称,项目名称等后,显示的下一个窗口是: 在此处输入图片说明

Make sure you check the Create Activity checkbox, otherwise the activity will not be created by default. 确保选中创建活动复选框,否则默认情况下不会创建活动。

You still can create an activity by right-clicking on the project and New > Other > Android > Android Activity . 您仍然可以通过右键点击项目,然后依次点击新建>其他> Android> Android Activity来创建活动 But you have to make sure you check the Launcher Activity checkbox in case it is the first activity of your application 但是您必须确保选中启动器活动复选框,以防它是应用程序的第一个活动

I hope this helps someone :) 我希望这可以帮助别人 :)

I had the same 'error' and it appears to me if when creating the app I use in the 'application name' non ASCII characters ! 我有同样的“错误”,如果在创建应用程序时使用“应用程序名称”中的非ASCII字符,对我来说似乎是错误的!

Example: čžšćđ... 示例:čžšćđ...

So do NOT USE čžšćđ in Application Name !!! 因此,请勿在应用程序名称中使用čžšćđ!

and yes I know it's not good practice to use them in programing :D

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

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