title: Unfortunately "app" has stopped issue with Android Studio
body: <p>Community</p>
  
  <p>I have been having issues getting this application to operate within the AVD. When I run the application it begins to load and then the error message "Unfortunately, MyMedicare has stopped" appears. My research on Google, Stack, and Youtube alleviates nothing. Anyone got any input?</p>
  
  <p>My MainActivity:</p>
  
  <pre><code>    package com.example.user.mymedicare;
  
  import com.example.user.mymedicare.R;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.view.ViewGroup.LayoutParams;
  import android.widget.Button;
  import android.widget.ImageButton;
  import android.widget.EditText;
  import android.widget.LinearLayout;
  import android.widget.TextView;
  import android.widget.*;
  
  public class MainActivity extends AppCompatActivity {
  
      public String result;
  
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //setContentView(R.layout.MainLayout);
  
          Button btnCalc = (Button) findViewById(R.id.btnCalc);
          btnCalc.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View MainLayout) {
                  EditText etxtWeight = (EditText)
                          findViewById(R.id.etxtWeight);
  
                  String strW = etxtWeight.getText().toString();
                  double weight = Double.parseDouble(strW);
  
                  EditText etxtHeight = (EditText)
                          findViewById(R.id.etxtHeight);
  
                  String strH = etxtHeight.getText().toString();
                  double height = Double.parseDouble(strH);
  
                  double h = height * 0.01;
                  double bmi = weight / (h*h);
  
                  if (bmi &lt;= 18.5) {
                      result = "You are Underweight!";
                  }
                  else if ((bmi &gt; 18.5) &amp;&amp; (bmi &lt;= 25.9)) {
                      result = "You are Healthy";
                  }
                  else {
                      result = "You are Overweight!";
                  }
  
                  String strBmi = Double.toString(Math.round(bmi));
                  TextView txtResults = (TextView)
                          findViewById(R.id.txtResults);
                  txtResults.setText("Your BMI is " + strBmi + " " + result);
              }
          });
      }
  }
  </code></pre>
  
  <p>My gradle:</p>
  
  <pre><code>    apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 24
      buildToolsVersion '24.0.1'
  
      defaultConfig {
          applicationId "com.example.user.mymedicare"
          minSdkVersion 15
          targetSdkVersion 24
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:24.1.0'
      compile 'com.android.support:design:24.1.0'
  }
  </code></pre>
  
  <p>My Manifest:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.user.mymedicare"&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>LogCat:</p>
  
  <pre><code>08-06 16:09:05.552 3502-3502/com.example.user.mymedicare I/art: Not late-enabling -Xcheck:jni (already on)
  08-06 16:09:06.392 3502-3502/com.example.user.mymedicare W/System: ClassLoader referenced unknown path: /data/app/com.example.user.mymedicare-1/lib/x86
  08-06 16:09:10.706 3502-3502/com.example.user.mymedicare W/System: ClassLoader referenced unknown path: /data/app/com.example.user.mymedicare-1/lib/x86
  08-06 16:09:10.768 3502-3502/com.example.user.mymedicare W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
  08-06 16:09:10.849 3502-3502/com.example.user.mymedicare D/AndroidRuntime: Shutting down VM
  
  
                                                                             --------- beginning of crash
  08-06 16:09:10.849 3502-3502/com.example.user.mymedicare E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: com.example.user.mymedicare, PID: 3502
                                                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.mymedicare/com.example.user.mymedicare.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:148)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                              Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at com.example.user.mymedicare.MainActivity.onCreate(MainActivity.java:24)
                                                                                 at android.app.Activity.performCreate(Activity.java:6237)
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                 at android.os.Looper.loop(Looper.java:148) 
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  08-06 16:26:38.175 8171-8171/com.example.user.mymedicare W/System: ClassLoader referenced unknown path: /data/app/com.example.user.mymedicare-1/lib/x86
  08-06 16:26:39.356 8171-8171/com.example.user.mymedicare W/System: ClassLoader referenced unknown path: /data/app/com.example.user.mymedicare-1/lib/x86
  08-06 16:26:39.402 8171-8171/com.example.user.mymedicare W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
  08-06 16:26:39.451 8171-8171/com.example.user.mymedicare D/AndroidRuntime: Shutting down VM
  08-06 16:26:39.451 8171-8171/com.example.user.mymedicare E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: com.example.user.mymedicare, PID: 8171
                                                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.mymedicare/com.example.user.mymedicare.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:148)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                              Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at com.example.user.mymedicare.MainActivity.onCreate(MainActivity.java:24)
                                                                                 at android.app.Activity.performCreate(Activity.java:6237)
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                 at android.os.Looper.loop(Looper.java:148) 
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  08-06 16:26:42.782 8171-8171/com.example.user.mymedicare I/Process: Sending signal. PID: 8171 SIG: 9
  08-06 16:26:45.505 8273-8273/com.example.user.mymedicare W/System: ClassLoader referenced unknown path: /data/app/com.example.user.mymedicare-1/lib/x86
  08-06 16:26:46.583 8273-8273/com.example.user.mymedicare W/System: ClassLoader referenced unknown path: /data/app/com.example.user.mymedicare-1/lib/x86
  08-06 16:26:46.630 8273-8273/com.example.user.mymedicare W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
  08-06 16:26:46.681 8273-8273/com.example.user.mymedicare D/AndroidRuntime: Shutting down VM
  08-06 16:26:46.681 8273-8273/com.example.user.mymedicare E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: com.example.user.mymedicare, PID: 8273
                                                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.mymedicare/com.example.user.mymedicare.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:148)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                              Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at com.example.user.mymedicare.MainActivity.onCreate(MainActivity.java:24)
                                                                                 at android.app.Activity.performCreate(Activity.java:6237)
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                 at android.os.Looper.loop(Looper.java:148) 
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  08-06 16:26:50.049 8273-8273/com.example.user.mymedicare I/Process: Sending signal. PID: 8273 SIG: 9
  08-06 16:27:02.056 8388-8388/com.example.user.mymedicare W/System: ClassLoader referenced unknown path: /data/app/com.example.user.mymedicare-1/lib/x86
  08-06 16:27:02.113 8388-8388/com.example.user.mymedicare W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
  08-06 16:27:02.163 8388-8388/com.example.user.mymedicare D/AndroidRuntime: Shutting down VM
  08-06 16:27:02.163 8388-8388/com.example.user.mymedicare E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: com.example.user.mymedicare, PID: 8388
                                                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.mymedicare/com.example.user.mymedicare.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:148)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                              Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
                                                                                 at com.example.user.mymedicare.MainActivity.onCreate(MainActivity.java:24)
                                                                                 at android.app.Activity.performCreate(Activity.java:6237)
                                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                                 at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                 at android.os.Looper.loop(Looper.java:148) 
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  08-06 16:27:04.722 8388-8388/com.example.user.mymedicare I/Process: Sending signal. PID: 8388 SIG: 9
  </code></pre>
  
  <p>If there is anything anyone can help with, shed light on, or suggest development ideas, I am all ears and happy to hear from you. </p>
  
  <p>Thanks in advance. =]</p>