Error:(90, 58) error: cannot find symbol variable drawable
<p>I am a begginer in Java for Android development. I am reading a book called "Android Application Development for Dummies". In chapter 5 of the book, the following code snippet is given which is not working.</p>

<p>Can someone please help me know what I'm doing wrong within the code?
All help is appreciated.</p>

<pre><code>package helloandroid.android.dummies.com.silentmodetoggle;

import android.support.v7.app.AppCompatActivity;

import android.graphics.drawable.Drawable;

import android.media.AudioManager;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.ImageView;


public class MainActivity extends AppCompatActivity {

private AudioManager mAudioManager;
private boolean mPhoneIsSilent;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    setButtonClickListener();

    mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);

    checkIfPhoneIsSilent();

    setButtonClickListener();

}

private void setButtonClickListener() {


    Button toggleButton = (Button) findViewById(R.id.toggleButton);
    toggleButton.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {

            if (mPhoneIsSilent) {
                //Change back to silent mode

                mAudioManager
                        .setRingerMode(AudioManager.RINGER_MODE_NORMAL);
                mPhoneIsSilent = false;
            } else {
                // Change to silent mode

                mAudioManager
                        .setRingerMode(AudioManager.RINGER_MODE_SILENT);
                mPhoneIsSilent = true;


            }
            // Now toggle the UI again

            toggleUI();


        }
    });
}

/**
 * Checks to see if the phone is currently in silent mode
 */
private void checkIfPhoneIsSilent() {

    int ringerMode = mAudioManager.getRingerMode();
    if (ringerMode == AudioManager.RINGER_MODE_SILENT) {

        mPhoneIsSilent = true;
    } else {

        mPhoneIsSilent = false;

    }

}

/**
 * Toggles the UI images from silent to normal and vice versa
 */
private void toggleUI() {

    ImageView imageView = (ImageView) findViewById(R.id.phone_icon);
    Drawable newPhoneImage;

    if (mPhoneIsSilent) {
       newPhoneImage = getResources(drawable.phone_silent

    }
    else {
        newPhoneImage =
                getResources(drawable.phone_on);
    }

    imageView.setImageDrawable(newPhoneImage);

}

@Override
protected void onResume() {
    super.onResume();
    checkIfPhoneIsSilent();
    toggleUI();
}
}
</code></pre>

<p>Some kindly offer to help.
Thank you.</p>

<pre><code>UPDATE

10-12 13:53:28.672 2965-2965/? D/dalvikvm: Not late-enabling CheckJNI (already on)

10-12 13:53:28.692  

2965-2965/helloandroid.android.dummies.com.silentmodetoggle E/Trace: error

opening trace file: No such file or directory (2)


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/dalvikvm: 

Could not 

find method android.app.Application.registerOnProvideAssistDataListener, 

referenced from method 

   com.android.tools.fd.runtime.BootstrapApplication.registerOnProvideAssistDataListener

10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to resolve virtual method 231: Landroid/app

/Application;.registerOnProvideAssistDataListener (Landroid/app

/Application$OnProvideAssistDataListener;)


10-12 13:53:28.703 2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x6e at 0x0002


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/dalvikvm: Could 

not find method 

android.app.Application.unregisterOnProvideAssistDataListener, referenced

 from method 

com.android.tools.fd.runtime.BootstrapApplication.unregisterOnProvideAssistDataLis

tener

10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to resolve virtual method 234: Landroid/app

/Application;.unregisterOnProvideAssistDataListener (Landroid/app

/Application$OnProvideAssistDataListener;)V

10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x6e at 0x0002

10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/InstantRun: 

Instant Run Runtime started. Android package is 

helloandroid.android.dummies.com.silentmodetoggle, real application class is 
</code></pre>

<p>null.</p>

<pre><code>10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/InstantRun: No

 instant run dex files added to classpath


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle E/dalvikvm: Could 

not find class 'android.util.ArrayMap', referenced from method 

com.android.tools.fd.runtime.MonkeyPatcher.monkeyPatchExistingResources


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY:

 unable to resolve check-cast 1884 (Landroid/util/ArrayMap;) in Lcom/android

/tools/fd/runtime/MonkeyPatcher;


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x1f at 0x025e


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle E/dalvikvm: Could 

not find class 'android.util.ArrayMap', referenced from method 

com.android.tools.fd.runtime.MonkeyPatcher.pruneResourceCache


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to resolve const-class 1884 (Landroid/util/ArrayMap;) in Lcom/android

/tools/fd/runtime/MonkeyPatcher;


10-12 13:53:28.703 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x1c at 0x0060


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/dalvikvm: Could

 not find method android.view.Window$Callback.onProvideKeyboardShortcuts,     

referenced from method     

android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to resolve interface method 15983: Landroid/view

/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid

/view/Menu;I)V


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x72 at 0x0002


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to find class referenced in signature (Landroid/view/SearchEvent;)


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/dalvikvm: Could 

not find method android.view.Window$Callback.onSearchRequested, referenced

 from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to resolve interface method 15985: Landroid/view

/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x72 at 0x0002


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/dalvikvm: Could 

not find method android.view.Window$Callback.onWindowStartingActionMode, 

referenced from method 

android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode


10-12 13:53:28.732

 2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to resolve interface method 15989: Landroid/view

/Window$Callback;.onWindowStartingActionMode (Landroid/view

/ActionMode$Callback;I)Landroid/view/ActionMode;


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x72 at 0x0002


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/dalvikvm: Could

 not find method android.content.res.TypedArray.getChangingConfigurations, 

referenced from method 

android.support.v7.widget.TintTypedArray.getChangingConfigurations


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY: 

unable to resolve virtual method 669: Landroid/content

/res/TypedArray;.getChangingConfigurations ()I


10-12 13:53:28.732 


2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY:

 replacing opcode 0x6e at 0x0002


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle I/dalvikvm: Could 

not find method android.content.res.TypedArray.getType, referenced from

 method android.support.v7.widget.TintTypedArray.getType


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm: VFY:

 unable to resolve virtual method 691: Landroid/content

/res/TypedArray;.getType (I)I


10-12 13:53:28.732

 2965-2965/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: VFY: 

replacing opcode 0x6e at 0x0008


10-12 13:53:28.732 

2965-2965/helloandroid.android.dummies.com.silentmodetoggle 

E/VdcInflateDelegate: Exception while inflating &lt;vector

org.xmlpull.v1.XmlPullParserException: Binary XML file line    #17&lt;vector&gt; 

tag requires viewportHeight &gt; 0
at 
</code></pre>

<p>android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(</p>

<pre><code>VectorDrawableCompat.java:544)
at 
android.support.graphics.drawable.VectorDrawableCompat.inflate

(VectorDrawableCompat.java:478)
at     
</code></pre>

<p>android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner</p>

<pre><code>(VectorDrawableCompat.java:441)
 at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:742)
 at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:362)
 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:192)
 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:185)
 at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:720)
 at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
 at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
 at 

android.support.v7.app.AppCompatDelegateImplBase.&lt;init&gt;(AppCompatDelegateImplBase.java:127)
at android.support.v7.app.AppCompatDelegateImplV9.&lt;init
(AppCompatDelegateImplV9.java:147)
 at android.support.v7.app.AppCompatDelegateImplV11.&lt;init&gt;

(AppCompatDelegateImplV11.java:27)
 at android.support.v7.app.AppCompatDelegateImplV14.&lt;init&gt;

(AppCompatDelegateImplV14.java:50)
  at 

android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:201)
  at 

android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:181)
  at
</code></pre>

<p>android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:521)
      at </p>

<pre><code>android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
  at 

helloandroid.android.dummies.com.silentmodetoggle.MainActivity.onCreate(MainActivity.java:18)
at android.app.Activity.performCreate(Activity.java:5008)
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
 at     

android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    at 

android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
   at   

android.app.ActivityThread.access$600(ActivityThread.java:130)
   at 

 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
                                                                                   at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                    at android.os.Looper.loop(Looper.java:137)
  at android.app.ActivityThread.main(ActivityThread.java:4745)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:511)
  at 
</code></pre>

<p>com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      at dalvik.system.NativeStart.main(Native Metho
     10-12 13:53:28.732       </p>

<pre><code> 2965-2965/helloandroid.android.dummies.com.silentmodetoggle

 D/AndroidRuntime: Shutting down VM

 10-12 13:53:28.732 
 2965-2965/helloandroid.android.dummies.com.silentmodetoggle W/dalvikvm:
 threadid=1: thread exiting with uncaught exception (group=0xb2e51288)
 10-12 13:53:28.732 
 2965-2965/helloandroid.android.dummies.com.silentmodetoggle 

E/AndroidRuntime: 
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity 
  ComponentInfo{helloandroid.android.dummies.com.silentmodetoggle/helloandroid.andro
id.dummies.com.silentmodetoggle.MainActivity}:                 
android.content.res.Resources$NotFoundException: File res/drawable
/abc_vector_test.xml from drawable resource ID #0x7f02005
at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059
at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at 
android.app.ActivityThread.access$600(ActivityThread.java:13
at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at       
</code></pre>

<p>com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
     at dalvik.system.NativeStart.main(Native Method)
    Caused by: android.content.res.Resources$NotFoundException: File res/drawable</p>

<pre><code>/abc_vector_test.xml from drawable resource ID #0x7f020052
at android.content.res.Resources.loadDrawable(Resources.java:1918)
at android.content.res.Resources.getDrawable(Resources.java:659)
at 

android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:346)
at 
</code></pre>

<p>android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:185)
    at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:720)
          at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
          at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
     at android.support.v7.app.AppCompatDelegateImplBase.   (AppCompatDelegateImplBase.java:127)
           at android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:147)
          at android.support.v7.app.AppCompatDelegateImplV11.(AppCompatDelegateImplV11.java:27)
           at android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:50)
            at </p>

<pre><code>android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:201)
        at 

android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:181)
       at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:521)
        at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
        at helloandroid.android.dummies.com.silentmodetoggle.MainActivity.onCreate(MainActivity.java:18)
          at android.app.Activity.performCreate(Activity.java:5008)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 
        at android.app.ActivityThread.access$600(ActivityThread.java:130) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
         at android.os.Handler.dispatchMessage(Handler.java:99) 
       at android.os.Looper.loop(Looper.java:137) 
        at android.app.ActivityThread.main(ActivityThread.java:4745) 
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:511) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
        at dalvik.system.NativeStart.main(Native Method) 
        Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
         at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:877)
          at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)
         at android.content.res.Resources.loadDrawable(Resources.java:1915)
         at android.content.res.Resources.getDrawable(Resources.java:659) 
         at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:346) 
         at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197) 
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:185) 
         at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:720) 
         at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190) 
        at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77) 
         at android.support.v7.app.AppCompatDelegateImplBase.&lt;init&gt;(AppCompatDelegateImplBase.java:127) 
         at android.support.v7.app.AppCompatDelegateImplV9.&lt;init&gt;(AppCompatDelegateImplV9.java:147) 
          at android.support.v7.app.AppCompatDelegateImplV11.&lt;init&gt;(AppCompatDelegateImplV11.java:27) 
           at android.support.v7.app.AppCompatDelegateImplV14.&lt;init&gt;(AppCompatDelegateImplV14.java:50) 
          at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:201) 
          at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:181) 
           at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:521) 
           at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71) 
           at helloandroid.android.dummies.com.silentmodetoggle.MainActivity.onCreate(MainActivity.java:18) 
           at android.app.Activity.performCreate(Activity.java:5008) 
           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 
             at android.app.ActivityThread.access$600(ActivityThread.java:130) 
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
            at android.os.Handler.dispatchMessage(Handler.java:99) 
            at android.os.Looper.loop(Looper.java:137) 
            at android.app.ActivityThread.main(ActivityThread.java:4745) 
            at java.lang.reflect.Method.invokeNative(Native Method) 
             at java.lang.reflect.Method.invoke(Method.java:511) 
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
           at dalvik.system.NativeStart.main(Native Method) 
10-12 13:53:28.752 

2965-2969/helloandroid.android.dummies.com.silentmodetoggle D/dalvikvm: 

GC_CONCURRENT freed 305K, 7% free 6071K/6471K, paused 16ms+1ms, total 18ms

10-12 13:53:31.472 2965-2965/? I/Process: Sending signal. PID: 2965 SIG: 9
</code></pre>

<blockquote>
  <p>The above is the Exception Logcat which I found very difficult to paste
      However, somehow I managed. 
      Your updated and edited answer is giving an error at the "else" block.</p>
</blockquote>