Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8656923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:23:54+00:00 2026-06-12T15:23:54+00:00

Hi I am completely new to Android programming and the question I am asking

  • 0

Hi I am completely new to Android programming and the question I am asking might be something very simple, but I do not have any idea about how to make it work, so kindly bear with me.

I installed android-sdk and related tools from the Android developer site. I followed their instructions to create a HelloWorld app, but I am getting some errors which I don’t understand.

The file MainActivity.java is an auto generated file and I keep getting errors in this file in these places:

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main); // error in activity_main
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  getMenuInflater().inflate(R.menu.activity_main, menu); // error in activity_main
   return true;
 }

So I went and tried to look through the generated class file for layout.class and found there is no variable called activity_main there.

Can anyone kindly suggest what to do here? Any help will be deeply appreciated.

The directory structure shows me that I do have the AndroidManifest.xml.

When I try to run the app, I get this specific error:

     AndroidManifest.xml file missing!
     Unknown Android Packaging Problem

These are some of the errors that i am getting when trying to get it running :

        10-10 23:31:11.305: E/Trace(946): error opening trace file: No such file or directory (2)
        10-10 23:31:11.955: E/AndroidRuntime(946): FATAL EXCEPTION: main
        10-10 23:31:11.955: E/AndroidRuntime(946): android.content.res.Resources$NotFoundException: Resource ID #0x2
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.content.res.Resources.getValue(Resources.java:1013)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.content.res.Resources.loadXmlResourceParser(Resources.java:2098)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.content.res.Resources.getLayout(Resources.java:852)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.view.MenuInflater.inflate(MenuInflater.java:107)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at com.example.myfirstapp.MainActivity.onCreateOptionsMenu(MainActivity.java:18)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.app.Activity.onCreatePanelMenu(Activity.java:2476)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:393)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:747)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:2913)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.os.Handler.handleCallback(Handler.java:615)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.os.Handler.dispatchMessage(Handler.java:92)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.os.Looper.loop(Looper.java:137)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at android.app.ActivityThread.main(ActivityThread.java:4745)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at java.lang.reflect.Method.invokeNative(Native Method)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at java.lang.reflect.Method.invoke(Method.java:511)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        10-10 23:31:11.955: E/AndroidRuntime(946):  at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:23:56+00:00Added an answer on June 12, 2026 at 3:23 pm

    Just build your project or Clean it as “Clayton” mentioned below.

    Project > Build All

    Project > Clean

    This I believe is because you do not have R.java file in your gen folder. Building your project will generate the R.java file in your gen folder and the errors should go away.

    This happens because you’re referring to your layout file using the following code

    setContentView(R.layout.activity_main); 
    

    The reference to R.layout.activity_main is declared in R.java file which needs to be generated by building your project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm completely new to Eclipse/Java/Android programming, so this might sound like a dumb question,
I am new to Android and I have bound my application completely but I
I am kind of new in Android and SQL (not completely newbie, but not
I'm completely new to programming on the Android platform but I'm interested in learning
Im completely new to Android so apologies if this is a silly question. But
I have following json generated by my website. I'm completely new with android programming.
I am completely new to android, and pretty much a Java newb. I have
I am Completely new to Objective C and Cocoa programming. Why does NSApplicationMain not
I'm quite new to Android programming but familiar with C/C++ and Linux enough to
I'm completely new to Android development, but I just got a HTC Hero and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.