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

  • SEARCH
  • Home
  • 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 8605733
In Process

The Archive Base Latest Questions

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

I have recently started Android development on API version 16 (4.1). According to the

  • 0

I have recently started Android development on API version 16 (4.1). According to the tutorials that are available on developer.android.com I started to develop the app which taught me the use of Intents. The problem is that as soon as my app is loading on the Emulator it shows the error that the app had to shut down. I am giving my xml code. Can someone please tell me where I am going wrong? Thanks.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" 
android:orientation="horizontal">


<EditText
    android:id="@+id/et1"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:hint="Edit text"
    android:layout_weight="1"
    tools:ignore="HardcodedText" />

<Button
    android:id="@+id/b1"
    android:layout_width="wrap_content"
    android:layout_height="40dp"
    android:text="Press"
    android:onClick="sendMessage"
    tools:ignore="HardcodedText" />

</LinearLayout>

The logcat is given below.

09-26 19:35:03.880: E/Trace(615): error opening trace file: No such file or directory     (2)
09-26 19:35:04.430: D/AndroidRuntime(615): Shutting down VM
09-26 19:35:04.430: W/dalvikvm(615): threadid=1: thread exiting with uncaught exception  (group=0x40a13300)
09-26 19:35:04.471: E/AndroidRuntime(615): FATAL EXCEPTION: main
09-26 19:35:04.471: E/AndroidRuntime(615): java.lang.RuntimeException: Unable to     instantiate activity ComponentInfo{com.learn.training1/com.learn.training1.Training1}:     java.lang.NullPointerException
 09-26 19:35:04.471: E/AndroidRuntime(615):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.os.Looper.loop(Looper.java:137)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.app.ActivityThread.main(ActivityThread.java:4745)
09-26 19:35:04.471: E/AndroidRuntime(615):  at java.lang.reflect.Method.invokeNative(Native Method)
09-26 19:35:04.471: E/AndroidRuntime(615):  at java.lang.reflect.Method.invoke(Method.java:511)
09-26 19:35:04.471: E/AndroidRuntime(615):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-26 19:35:04.471: E/AndroidRuntime(615):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-26 19:35:04.471: E/AndroidRuntime(615):  at dalvik.system.NativeStart.main(Native Method)
09-26 19:35:04.471: E/AndroidRuntime(615): Caused by: java.lang.NullPointerException
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.app.Activity.findViewById(Activity.java:1825)
09-26 19:35:04.471: E/AndroidRuntime(615):  at com.learn.training1.Training1.<init>(Training1.java:15)
09-26 19:35:04.471: E/AndroidRuntime(615):  at java.lang.Class.newInstanceImpl(Native Method)
09-26 19:35:04.471: E/AndroidRuntime(615):  at java.lang.Class.newInstance(Class.java:1319)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
09-26 19:35:04.471: E/AndroidRuntime(615):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
09-26 19:35:04.471: E/AndroidRuntime(615):  ... 11 more
09-26 19:35:32.352: I/Process(615): Sending signal. PID: 615 SIG: 9
09-26 19:39:22.460: E/Trace(664): error opening trace file: No such file or directory (2)
09-26 19:39:22.820: D/AndroidRuntime(664): Shutting down VM
09-26 19:39:22.820: W/dalvikvm(664): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
09-26 19:39:22.846: E/AndroidRuntime(664): FATAL EXCEPTION: main
09-26 19:39:22.846: E/AndroidRuntime(664): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.learn.training1/com.learn.training1.Training1}: java.lang.NullPointerException
 09-26 19:39:22.846: E/AndroidRuntime(664):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.os.Looper.loop(Looper.java:137)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.app.ActivityThread.main(ActivityThread.java:4745)
09-26 19:39:22.846: E/AndroidRuntime(664):  at java.lang.reflect.Method.invokeNative(Native Method)
09-26 19:39:22.846: E/AndroidRuntime(664):  at java.lang.reflect.Method.invoke(Method.java:511)
09-26 19:39:22.846: E/AndroidRuntime(664):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-26 19:39:22.846: E/AndroidRuntime(664):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-26 19:39:22.846: E/AndroidRuntime(664):  at dalvik.system.NativeStart.main(Native Method)
09-26 19:39:22.846: E/AndroidRuntime(664): Caused by: java.lang.NullPointerException
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.app.Activity.findViewById(Activity.java:1825)
09-26 19:39:22.846: E/AndroidRuntime(664):  at com.learn.training1.Training1.<init>(Training1.java:15)
09-26 19:39:22.846: E/AndroidRuntime(664):  at java.lang.Class.newInstanceImpl(Native Method)
09-26 19:39:22.846: E/AndroidRuntime(664):  at java.lang.Class.newInstance(Class.java:1319)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
09-26 19:39:22.846: E/AndroidRuntime(664):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
09-26 19:39:22.846: E/AndroidRuntime(664):  ... 11 more
09-26 19:40:29.130: E/Trace(712): error opening trace file: No such file or directory (2)
09-26 19:40:29.431: D/dalvikvm(712): newInstance failed: Lcom/learn/training1/Training1; not accessible to Landroid/app/Instrumentation;
09-26 19:40:29.431: D/AndroidRuntime(712): Shutting down VM
09-26 19:40:29.431: W/dalvikvm(712): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
09-26 19:40:29.461: E/AndroidRuntime(712): FATAL EXCEPTION: main
09-26 19:40:29.461: E/AndroidRuntime(712): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.learn.training1/com.learn.training1.Training1}: java.lang.IllegalAccessException: access to class not allowed
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.os.Looper.loop(Looper.java:137)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.app.ActivityThread.main(ActivityThread.java:4745)
09-26 19:40:29.461: E/AndroidRuntime(712):  at java.lang.reflect.Method.invokeNative(Native Method)
09-26 19:40:29.461: E/AndroidRuntime(712):  at java.lang.reflect.Method.invoke(Method.java:511)
09-26 19:40:29.461: E/AndroidRuntime(712):  at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-26 19:40:29.461: E/AndroidRuntime(712):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-26 19:40:29.461: E/AndroidRuntime(712):  at dalvik.system.NativeStart.main(Native Method)
09-26 19:40:29.461: E/AndroidRuntime(712): Caused by: java.lang.IllegalAccessException: access to class not allowed
09-26 19:40:29.461: E/AndroidRuntime(712):  at java.lang.Class.newInstanceImpl(Native Method)
09-26 19:40:29.461: E/AndroidRuntime(712):  at java.lang.Class.newInstance(Class.java:1319)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
09-26 19:40:29.461: E/AndroidRuntime(712):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
09-26 19:40:29.461: E/AndroidRuntime(712):  ... 11 more
09-26 19:43:52.020: E/Trace(760): error opening trace file: No such file or directory (2)
09-26 19:43:52.110: D/dalvikvm(760): newInstance failed: Lcom/learn/training1/Training1; not accessible to Landroid/app/Instrumentation;
09-26 19:43:52.110: D/AndroidRuntime(760): Shutting down VM
09-26 19:43:52.110: W/dalvikvm(760): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
09-26 19:43:52.190: E/AndroidRuntime(760): FATAL EXCEPTION: main
09-26 19:43:52.190: E/AndroidRuntime(760): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.learn.training1/com.learn.training1.Training1}: java.lang.IllegalAccessException: access to class not allowed
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.os.Looper.loop(Looper.java:137)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.app.ActivityThread.main(ActivityThread.java:4745)
09-26 19:43:52.190: E/AndroidRuntime(760):  at java.lang.reflect.Method.invokeNative(Native Method)
 09-26 19:43:52.190: E/AndroidRuntime(760):     at java.lang.reflect.Method.invoke(Method.java:511)
09-26 19:43:52.190: E/AndroidRuntime(760):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-26 19:43:52.190: E/AndroidRuntime(760):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-26 19:43:52.190: E/AndroidRuntime(760):  at dalvik.system.NativeStart.main(Native Method)
09-26 19:43:52.190: E/AndroidRuntime(760): Caused by: java.lang.IllegalAccessException: access to class not allowed
09-26 19:43:52.190: E/AndroidRuntime(760):  at java.lang.Class.newInstanceImpl(Native Method)
09-26 19:43:52.190: E/AndroidRuntime(760):  at java.lang.Class.newInstance(Class.java:1319)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
09-26 19:43:52.190: E/AndroidRuntime(760):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
09-26 19:43:52.190: E/AndroidRuntime(760):  ... 11 more
09-26 19:47:20.550: I/Process(810): Sending signal. PID: 810 SIG: 9
  • 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-12T02:54:44+00:00Added an answer on June 12, 2026 at 2:54 am

    Looks like your activity isn’t properly declared (maybe you didn’t make it public?). You should have a file called Training1.java and in this file you should have something like

    public class Training1 extends Activity {
        ...your activity code here...
    }
    

    See https://groups.google.com/forum/?fromgroups=#!topic/android-developers/0Gw5WHc1J6g

    EDIT: Add note

    Note: Also, you shouldn’t have any constructors. The Android framework takes care of that for you.

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

Sidebar

Related Questions

I have recently started making an Android app that requires a list of 20
I have just recently started out programming for Android, and have decided that I
I have a weird problem that only started recently. When I run the app
I have recently started working with Android. I don't have that much experience with
I have recently just started learning how to develop android applications. I am am
I have recently started learning Android development. In the android-sdk/tools folder, there should be
I have recently started Android development, and i already know Java. So i was
I am new to android development. Recently I have uploaded an android app using
I have recently started to learn Objective-C and write my tests using OCUnit that
I have recently started work on an application that is already deployed to production.

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.