Problem with the Emulator running my App

+1 Carlos Hernandez · October 26, 2015
I have been practicing with HyperSTV on youtube. Video- Android Apps Development Tutorial for Beginners (1) - 2015

in the very last 20 Minutes of the video, I have followed every step, yet when I try to run my Java made app on the emulator, I receive this error message.

10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime: FATAL EXCEPTION: main
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime: Process: com.example.carlos.java, PID: 2895
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.carlos.java/com.example.carlos.java.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.support.v7.internal.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:100)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.support.v7.internal.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:93)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.support.v7.internal.app.ToolbarActionBar.<init>(ToolbarActionBar.java:78)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setSupportActionBar(AppCompatDelegateImplV7.java:206)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:99)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at com.example.carlos.java.MainActivity.onCreate(MainActivity.java:49)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-23 22:39:28.565 2895-2895/com.example.carlos.java E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

Does anyone know what this is and how to fix it?

I am new to the programming/ app developing world, help would be much appreciated. 

the .carlos is my name, Carlos     and the .java is the name of my application        just to clarify.

Thank you! 

Post a Reply

Replies

Oldest  Newest  Rating
0 Parth Gupta · October 31, 2015
i got the same prob...
so i fixed it up in this way-
delete the content_main.xml file..
if ur emulator is working ie it gets started and android screen gets displayed but still your app doesnt run then find if you get an error of - HAXM not working properly and emulator runs in emulation mode. if you get this then post here ,i will tell the further steps.
0 Parth Gupta · October 31, 2015
i got the same prob..
so i fixed it by deleting the content_main.xml.
do this and see if it works.
0 Arvind Jaiswal · October 30, 2015
I have got the same problem while running the code. I cannot understand why it  occurred. Perhaps, the new version of Android Studio is creating the issue. It opens 2 .xml files (content_main.xml and activity_main.xml). But as the video suggests, the code does not have to do anything with xml part.  Please, Bucky! Help us. 
0 Ayrton Muniz · November 7, 2015
Question to you guys: Do you have an Intel processor or not? if you don't get the same software Bucky got in the tutorial. Instead go to the SDK and get the ARM emulator thing. It worked for me but its super slow. If you can't find it on the bottom right there is a box to check to see more stuff to download. This is all i know i'm sorry if i don't make sense i'm new to this too.
  • 1

Java / Android Development

107,230 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator