6

I had recently updated my Android SDK from 22.3 to 22.6. After updating, I tried creating a Blank Activity using the wizard. I am unable to create one as I used to create earlier. Also, I am unable to create LoginActivity, or Settings Activity etc.

I somehow managed to create the Activity through wizard, I found that instead of extending simple Activity, my class was extending something else.

How can I resolve this problem?

halfer
  • 19,824
  • 17
  • 99
  • 186
Atish Agrawal
  • 2,857
  • 1
  • 23
  • 38
  • 2
    possible duplicate of http://stackoverflow.com/questions/22278479/eclipse-doesnt-generate-mainactivity-java-activity-main-xml – Anirudha Agashe Mar 09 '14 at 05:18
  • I've answered to a similar question here: http://stackoverflow.com/questions/22289164/adt-blank-activity-created-with-fragment-activity The answer: http://stackoverflow.com/a/22684192/389324 – saran Mar 27 '14 at 10:10

4 Answers4

1

I have not suffer this problem with 22.6 but with 23. In my case, the problem seems to be the free maker sintax of the .flt files of the template.

Just in case this could be useful to others, I've solved this issue changing two files:

$ANDROID_SDK/tools/templates/activities/BlankActivity/recipe.xml.ftl original:

<?xml version="1.0"?>
<recipe>
    <#if appCompat><dependency mavenUrl="com.android.support:appcompat-v7:19.+"/></#if>
    ...

I've added ?has_content after <#if appCompat in line 4:

<?xml version="1.0"?>
<recipe>
    <#if appCompat?has_content><dependency mavenUrl="com.android.support:appcompat-v7:19.+"/></#if>
    ...

The other file is $ANDROID_SDK/tools/templates/activities/BlankActivity/root/res/menu/main.xml.ftl. The original version starts with:

<menu xmlns:android="http://schemas.android.com/apk/res/android"<#if appCompat>
...

I've added the same string at the end:

<menu xmlns:android="http://schemas.android.com/apk/res/android"<#if appCompat?has_content>
...

The same errors exist in many other activities templates...

Keep in mind that these changes will be overwriten with the next SDK update... I hope Google solve this issue, because developping for Android with Eclipse is becoming a headache.

Googol
  • 2,572
  • 20
  • 9
0

I also have that issue, seems a bug in new SDK tools

Chatura Dilan
  • 1,502
  • 1
  • 16
  • 29
0

I saw the update link today

check here

Atish Agrawal
  • 2,857
  • 1
  • 23
  • 38
0

I was having the same problem, so I updated the Android to 1.5 and after the SDK version. It works for me.

Android Studio 1.5 link: http://tools.android.com/download/studio/builds/1-5-rc-1