Eclipse Juno won't create Android Activity

2019-01-11 20:09发布

问题:

I downloaded Eclipse Juno Java EE edition and installed ADT plugin. I created a new Android Application Project from Eclipse and in the wizard I created an activity called TaskariActivity. After I pressed finish, it created the project but not the activity and the wizard didn't close. I pressed cancel. No activity or anything in the src folder. I created a new activity by right clicking on src, selecting new -> other -> Android -> activity. I selected BlankActivity (as earlier when I was creating the project), selected the earlier created project in the Project combo box. I set the Activity name as TaskariActivity, layout name as activity_main and title as TaskariActivity. Next I selected navigation type and I set it to Tabs + Swipe (I thought this would make me tabs and everything I had to do would be just inserting the elements and the actions for them). I pressed next, nothing happened. Finish didn't also do anything. I pressed cancel and an activity wasn't created.

So, how can I create an Android application like in the earlier version of Eclipse? It automatically created the activity and it was ready be run out of the box. Now it won't generate any files and the new activity wizard doesn't work. Help?

回答1:

Just go with default launcher image (blue smiley) instead of customizing it and it should work ;)



回答2:

Okay, this worked for me: "Help" -> "Install new software" and install (this will update it) from this url: https://dl-ssl.google.com/android/eclipse/ I guess the Android website doesn't have an up-to-date version of ADT? Not sure where you're supposed to download the latest version from



回答3:

Workaround that worked for me (If you have installed support library>8 and still get the error msg)

  • Delete the support library from the SDK manager
  • Create a new project & install the support library by clicking on "Install / Upgrade"

Check this answer.



回答4:

I solved this same issue by updating the support library (through the Android SDK Manager, it is located at the end of the list under Extras > Android Support Library) from rev.8 to rev.9!

After updating, Eclipse is now able to create projects as expected.



回答5:

I had the same problem and I could create the project changing the "minimum required SDK" to 3.0 Honeycomb.

What is the versión you have selected?