7

The problem is, in Eclipse, the new >> Project >> Android >> Android Application Project >> BlankActivity does not create any Activities in the src directory, and does not include the Activities in the manifest.xml.

I know this question has been asked before:

  1. Eclipse Juno won't create Android Activity
  2. Eclipse doesn't create Main Activity and layout
  3. Eclipse android project not creating blank activity

However, the selected answers to these all say somthing like:

click "Help" -> "Install new software" and install (this will update it) from this url: https://dl-ssl.google.com/android/eclipse/

The above answer did not work for me. Here are some details of my setup:

  1. Installed "Eclipse ADT" from the Android website
  2. Followed the installation instructions (unzipped contents and opened Eclipse)
  3. Downloaded necessary APIs using the ADT Manager
  4. Tried creating new >> Project >> Android >> Android Application Project >> BlankActivity, this worked fine except no Activity in src or manifest.xml.

  5. Tried the answer given in other SO questions, i.e. "Install new software" and install (this will update it) from this url: https://dl-ssl.google.com/android/eclipse/ . This updated "Development Tools" to version 23.0.

  6. Tried creating new >> Project >> Android >> Android Application Project >> BlankActivity, but still did not work.

I know I could install these files manually, but I am following the Android Dev Tutorials and they often assume the base project creation worked perfectly, and do not give the source files.

Community
  • 1
  • 1
Jillian
  • 113
  • 1
  • 6
  • 1
    `new >> Other >> Android >> Android Application Project`. Refer [Creating First Project](http://developer.android.com/training/basics/firstapp/creating-project.html). Remember, Google is your best friend – VenomVendor Jun 28 '14 at 17:50
  • I'm creating projects as you describe, and I am following the direction on the link you give already. – Jillian Jun 28 '14 at 18:05
  • Check that you are checking all the necessary boxes prior to hitting "Finish" – Ojonugwa Jude Ochalifu Jun 29 '14 at 00:06
  • 1
    The same thing is happening for me. I think it's a bug with the current ADT. You need to select "Empty Activity" instead of "Blank Activity". I think Blank activity was supposed to be removed – Gak2 Jun 29 '14 at 01:25
  • @Gak2 yes, I've been using `EmptyActivity`. It's just that the main tutorials on [Creating First Project](http://developer.android.com/training/basics/firstapp/creating-project.html) use `BlankActivity`, which includes the `ActionBarActivity`. It's a little frustrating not to be able to follow the official tutorials. – Jillian Jun 29 '14 at 02:58

4 Answers4

4

its currently bugged if you updated to 23.0. see https://code.google.com/p/android/issues/detail?id=72419

Asura
  • 859
  • 5
  • 15
2

Just wanted to add, I switched from Eclipse ADT to the Android Studio and all of the Activity creations work perfectly (i.e. BlankActivity, as well as all of the others). It also fixed another bug I was experiencing with the GUI preview in Eclipse.

Jillian
  • 113
  • 1
  • 6
  • I too switched to Android Studio now from Eclipse ADT just today and trying to run the show. But I'm getting "Error:Cause: error in opening zip file". Any Idea, what might have gone wrong ? BTW, I'm in Win7 64 bit OS – Ramakishna Balla Jul 01 '14 at 04:58
  • Looks like this "http://stackoverflow.com/questions/23828085/android-studio-failed-to-complete-gradle-execution-error-in-opening-zip-file" already has an answer and I'm trying to follow the steps...Will update in SO if it gets resolved and starts working – Ramakishna Balla Jul 01 '14 at 05:23
  • Update - Able to run through Android Studio Without any Issues now...Feels better to be in AS than ECLP :) – Ramakishna Balla Jul 01 '14 at 06:30
0

I had the same problem. I tried installing the ADT plugin + Eclipse bundle and when I tried their "My First App" example Eclipse would not create an activity.

Manually installing Eclipse first and then adding the latest ADT plugin worked for me.

  1. I installed Eclipse Standard 4.4 first (http://www.eclipse.org/downloads/).
  2. Then I installed the Android SDK (https://developer.android.com/sdk/index.html - use the "GET THE SDK FOR AN EXISTING IDE" link)
  3. Then I installed the ADT plugin for Eclipse (https://developer.android.com/sdk/installing/installing-adt.html)
  4. Then I was able to follow their demo project successfully.

Eclipse does automatically create new activities and I can run the application on an actual device.

Hope that helps.

ashah
  • 193
  • 1
  • 4
  • 15
-1

I bypassed this issue by creating Empty Activity instead of Blank Activity while creating new android project. Empty Activity provided same code as that of Blank Activity

Learner_Programmer
  • 1,259
  • 1
  • 13
  • 38
  • This isn't true. `EmptyActivity` comes with no Activities. [**`BlankActivity`**](https://developer.android.com/tools/projects/templates.html#blank-activity) creates a main `Activity` that includes an `ActionBar`, `Menu`, basic layout, and has options to include a navigation type and use `Fragments`. Also, It's not just `BlankActivity` that doesn't work, it's everything except `EmptyActivity`. – bcorso Jul 08 '14 at 22:55
  • the solution I have provided is for BlankActivity not creating activtity issue in my case (Eclipse kepler with ADT 23).Creating a EmptyActivity created an activity and thereafter src folder contained that activity.I am not referring to other aspects of this issue. – Learner_Programmer Jul 09 '14 at 05:09