1

I am new in android app development & I have installed:

  • Android SDK tools Rev 20.0.3
  • Android SDK tools Rev 20.0.3
  • Android SDK Platform-tools Rev 3
  • Android 2.3.3(API 10) sdk platform rev 2
  • samples for sdk api 10 rev 1
  • ADT Plugin 20.0.3

When I create a new project in Eclipse, It automatically generate a HelloWorld app. However, when I try to run it I get the following error.

A pop-up window comes out with "Your project includes errors please fix them before running your application etc"

I have created AVD & set target in eclipse, but this problem still occurs.

Here is the Main.java file code

package com.rajarshi.learnactivity;

 import android.os.Bundle;
 import android.app.Activity;
 import android.view.Menu;

   public class Main extends Activity 
   {

   @Override
   public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
     {
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
     }
    }
Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
  • 2
    We can help you more if you tell us what are the errors.. – Nermeen Sep 05 '12 at 09:02
  • Please look your application and in which class do you get errors??? – user4232 Sep 05 '12 at 09:04
  • I can not add screenshots because I am a new user .but i will try to describe u the errors In the DDMS prospective ,logcat window i got a error msg "Device not connected " but I have created the virtual device .. – Rajarshi Rakshit Sep 05 '12 at 09:05
  • In the problems window there are two errors 1. Error generating final archive:java.io.FileNOtFoundException C:\Users\Home\workspace 2.Unparsed aapt error(s)! Check the console for output – Rajarshi Rakshit Sep 05 '12 at 09:09
  • remove the method oncreateoptionsmenu, then clean and build your application. – faizanjehangir Sep 05 '12 at 10:10

1 Answers1

0

you may create many like this,

and for your project error you may use Project -> Clean Option and try to clean your project , make sure that All Xml file is fine , and Drawable Resources name is proper, and run it again.

@Override
        public boolean onCreateOptionsMenu(Menu menu) {
            menu.clear();
            menu.add(1, 1, 0, "Share Info").setIcon(R.drawable.share);
            menu.add(1, 2, 1, "Chat").setIcon(R.drawable.chat);
            menu.add(1, 3, 2, "Copy Item").setIcon(R.drawable.folder);
            menu.add(1, 4, 3, "Move Item").setIcon(R.drawable.folder);
            menu.add(1, 5, 4, "Delete Item").setIcon(R.drawable.delete);
            menu.add(1, 6, 5, "Select Item").setIcon(R.drawable.folder);        
            // return super.onCreateOptionsMenu(menu);
            return true;
        } 
Ankitkumar Makwana
  • 3,475
  • 3
  • 19
  • 45
  • I got the solution for this question ..The problem arise due to the version problem of the "Android SDK Platform-tools Rev 3".This version not properly configured with the "Android SDK tools Rev 20.0.3" .The proper version is "Android SDK Platform-tools Rev 14" – Rajarshi Rakshit Sep 08 '12 at 09:19