5

I am still new in android development and just decided to learn. however i encounter some problem that drive me nuts this couple hours.. i just want to create a new project with this setting

New Project Setting

the problem is i can't create new blank activity with it, it says it requires a build target API version of at least 14, and the current version is 8

Activity Warning

I just want to try build an app that support from Android 2.2 (API 8) onwards.. is that just not possible right now to create an Android 2.2 compatible apps with blank activity template? so in order to use blank activity template i must use Android 4.0 (API 14)? is that correct?

Nikolius Lau
  • 653
  • 2
  • 11
  • 21

6 Answers6

6

It's new feature of ADT 22.6.2

Even in "None" theme ADT(22.6.2) create "Fragment Layout"

There is four ways:

  1. Try to change "Target" and "Compile" to API 14 or higher. But you need then remove all entries of "Fragment Layouts"

  2. Uncheck "Create activity" checkbox, and create activity manually. Good howto: Best way to add Activity to an Android project in Eclipse?

  3. Downgrade to 22.3.0 for example

  4. Try to change templates. In link below you find howto.

I use third way for my apps with APIs lower 14. In different directories I have installed 22.3.0 and 22.6.2

There in 22.6.2 is some other bugs with blank files and problems with AVD. New version of ADT really buggy...

Look also this links:

ADT blank activity created with fragment activity..

Eclipse doesn't generate MainActivity.java & activity_main.xml

and search, yep )

https://stackoverflow.com/search?q=adt+22.6


Added some new ways.

How I use it now:

  1. You can create project in 22.3.0 or lower. Then open it in 22.6 or greater.
  2. You can create project in 22.3.0 or lower and leave it blank. Then in 22.6 or greater you can use this blank project as template. Just copy this template-project and past it with new name as you new-project in Eclipse workspase.

Enjoy! )

Community
  • 1
  • 1
user3439968
  • 3,418
  • 1
  • 18
  • 15
  • Added some new ways. How I use it now: 5. You can create project in 22.3.0 or lower. Then open it in 22.6 or greater. 6. You can create project in 22.3.0 or lower and leave it blank. Then in 22.6 or greater you can use this blank project as template. Just copy this template-project and past it with new name as you new-project in Eclipse workspase. Enjoy! ) – user3439968 Sep 22 '14 at 15:29
1

it is going to be tricky building for such a version, you may leave you minimum Sdk at yoru desired. Still you must increase max, also if your minimum is anything less than 15, the ADK is now building an extra folder(new stuff) In truth the new version of the ADt is annoying, I am just starting and now you will see they have enforced the use of fragments.

1

I figured out that we can use Empty Activity instead of Blank Activity. Now in Empty is created a fragment, layout and R.java is updated.

gunr2171
  • 16,104
  • 25
  • 61
  • 88
Harison Silva
  • 98
  • 1
  • 8
1

I was in the same boat so I tried....And it worked!

This is with a brand new empty project i tried to start with SDK 8 set for min and target.

I was able to change the min and target SDK to a higher version(in my case 21). That allowed me to add an "Empty Activity". After the activity was added I just change the min and target back to 8. There were not any compile complaints and I was able to run it in a 2.2 emulator after I did the change

0

Change the minimum required SDK to 9 and the target SDK to 18

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
-1

create the project independently and u have to uncheck the create activity thing, then go back to to create android activity on its own then choose the master/detail view press next and check the launch activity box then press back and choose blank or empty activity then press finish all will be done, that's what I used and it worked out

abili
  • 1