title: android studio app crashes when setting gradient background
body: <p>My app crashed immediately when I'm setting gradient background, if I'm not doing this then everything is working.</p>
  
  <p>My activity_main.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/gradient_background"
      tools:context="com.example.uytkownik.myapplication.MainActivity"&gt;
  
      &lt;ProgressBar
          android:id="@+id/progressBar2"
          style="?android:attr/progressBarStyle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:layout_centerVertical="true"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>gradient_background.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item&gt;
          &lt;shape&gt;
              &lt;gradient
                  android:startColor="@color/gradientColBeg"
                  android:endColor="@color/gradientColEnd"
                  android:angle="90"/&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>colors.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;color name="colorPrimary"&gt;#3F51B5&lt;/color&gt;
      &lt;color name="colorPrimaryDark"&gt;#303F9F&lt;/color&gt;
      &lt;color name="colorAccent"&gt;#000000&lt;/color&gt;
      &lt;color name="gradientColBeg"&gt;#FFF&lt;/color&gt;
      &lt;color name="gradientColEnd"&gt;#000&lt;/color&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>stack trace:</p>
  
  <pre><code>12/30 15:39:05: Launching app
  $ adb install-multiple -r -t -p com.example.uytkownik.myapplication D:\Projekty\java\nauka\MyApplication\app\build\intermediates\split-apk\debug\slices\slice_0.apk D:\Projekty\java\nauka\MyApplication\app\build\outputs\apk\debug\app-debug.apk 
  Split APKs installed
  $ adb shell am start -n "com.example.uytkownik.myapplication/com.example.uytkownik.myapplication.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
  Connected to process 16680 on device huawei-huawei_y560_l01-Q6VBBBB5B0520663
  Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
  I/InstantRun: starting instant run server: is main process
  V/HwPolicyFactory: : success to get AllImpl object and return....
  V/HwWidgetFactory: : successes to get AllImpl object and return....
  E/art: ClassLinker::FindClass not found:Landroid/widget/ViewStub;
  E/art: ClassLinker::FindClass not found:Landroid/webkit/ViewStub;
  E/art: ClassLinker::FindClass not found:Landroid/app/ViewStub;
  W/ResourceType: Failure getting entry for 0x7f020053 (t=1 e=83) (error -75)
  D/AndroidRuntime: Shutting down VM
  E/AndroidRuntime: FATAL EXCEPTION: main
                    Process: com.example.uytkownik.myapplication, PID: 16680
                    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.uytkownik.myapplication/com.example.uytkownik.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2345)
                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407)
                        at android.app.ActivityThread.access$700(ActivityThread.java:155)
                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
                        at android.os.Handler.dispatchMessage(Handler.java:102)
                        at android.os.Looper.loop(Looper.java:135)
                        at android.app.ActivityThread.main(ActivityThread.java:5298)
                        at java.lang.reflect.Method.invoke(Native Method)
                        at java.lang.reflect.Method.invoke(Method.java:372)
                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
                     Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
                        at android.view.LayoutInflater.createView(LayoutInflater.java:633)
                        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
                        at com.android.internal.policy.impl.HwPhoneLayoutInflater.onCreateView(HwPhoneLayoutInflater.java:75)
                        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
                        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
                        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
                        at android.app.Activity.setContentView(Activity.java:2160)
                        at com.example.uytkownik.myapplication.MainActivity.onCreate(MainActivity.java:17)
                        at android.app.Activity.performCreate(Activity.java:6039)
                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407) 
                        at android.app.ActivityThread.access$700(ActivityThread.java:155) 
                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) 
                        at android.os.Handler.dispatchMessage(Handler.java:102) 
                        at android.os.Looper.loop(Looper.java:135) 
                        at android.app.ActivityThread.main(ActivityThread.java:5298) 
                        at java.lang.reflect.Method.invoke(Native Method) 
                        at java.lang.reflect.Method.invoke(Method.java:372) 
                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) 
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) 
                     Caused by: java.lang.reflect.InvocationTargetException
                        at java.lang.reflect.Constructor.newInstance(Native Method)
                        at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
                        at android.view.LayoutInflater.createView(LayoutInflater.java:607)
                        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) 
                        at com.android.internal.policy.impl.HwPhoneLayoutInflater.onCreateView(HwPhoneLayoutInflater.java:75) 
                        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) 
                        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) 
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:482) 
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378) 
                        at android.app.Activity.setContentView(Activity.java:2160) 
                        at com.example.uytkownik.myapplication.MainActivity.onCreate(MainActivity.java:17) 
                        at android.app.Activity.performCreate(Activity.java:6039) 
                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) 
                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407) 
                        at android.app.ActivityThread.access$700(ActivityThread.java:155) 
                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) 
                        at android.os.Handler.dispatchMessage(Handler.java:102) 
                        at android.os.Looper.loop(Looper.java:135) 
                        at android.app.ActivityThread.main(ActivityThread.java:5298) 
                        at java.lang.reflect.Method.invoke(Native Method) 
                        at java.lang.reflect.Method.invoke(Method.java:372) 
                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) 
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) 
                     Caused by: android.content.res.Resources$NotFoundException: Resource "com.example.uytkownik.myapplication:drawable/gradient_background" (7f020053)  is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020053 a=-1 r=0x7f020053}
                        at android.content.res.Resources.loadDrawableForCookie(Resources.java:2462)
                        at android.content.res.Resources.loadDrawable(Resources.java:2400)
                        at android.content.res.HwResources.loadDrawable(HwResources.java:609)
                        at android.content.res.TypedArray.getDrawable(TypedArray.java:785)
                        at android.view.View.&lt;init&gt;(View.java:3747)
                        at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:498)
                        at android.widget.RelativeLayout.&lt;init&gt;(RelativeLayout.java:249)
                        at android.widget.RelativeLayout.&lt;init&gt;(RelativeLayout.java:245)
                        at android.widget.RelativeLayout.&lt;init&gt;(RelativeLayout.java:241)
                        at java.lang.reflect.Constructor.newInstance(Native Method) 
                        at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
                        at android.view.LayoutInflater.createView(LayoutInflater.java:607) 
                        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) 
                        at com.android.internal.policy.impl.HwPhoneLayoutInflater.onCreateView(HwPhoneLayoutInflater.java:75) 
                        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) 
                        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) 
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:482) 
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                        at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378) 
                        at android.app.Activity.setContentView(Activity.java:2160) 
                        at com.example.uytkownik.myapplication.MainActivity.onCreate(MainActivity.java:17) 
                        at android.app.Activity.performCreate(Activity.java:6039) 
                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) 
                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407) 
                        at android.app.ActivityThread.access$700(ActivityThread.java:155) 
                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) 
                        at android.os.Handler.dispatchMessage(Handler.java:102) 
                        at android.os.Looper.loop(Looper.java:135) 
                        at android.app.ActivityThread.main(ActivityThread.java:5298) 
                        at java.lang.reflect.Method.invoke(Native Method) 
                        at java.lang.reflect.Method.invoke(Method.java:372) 
                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) 
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) 
  I/Process: Sending signal. PID: 16680 SIG: 9
  Application terminated.
  </code></pre>
  
  <p>I'm new to android studio, and I don't know what can cause that exception.
  I will apreciate any help, thanks very much!</p>