title: Error inflating class ImageView and ImageButton both
body: <p>I'm constantly trying to add Imageview inside my fragment Class but I'm getting Error and after I run the app, It stops with error of "Error Inflating class Imageview". But when I remove the Imageview and add Textview or Button only it works fine, Only with Imageview and ImageButton...It throws an error.</p>
  
  <p>I tried changing android:src to app:srcCompat= but also it doesn't work and image file is very small in range of 60kb too. </p>
  
  <p>Here is the Error log</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>03-15 12:26:49.540 30218-30218/com.nepalpolice.cdp E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
  03-15 12:26:49.680 30218-30218/com.nepalpolice.cdp E/AndroidRuntime: FATAL EXCEPTION: main
                                                                       Process: com.nepalpolice.cdp, PID: 30218
                                                                       java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nepalpolice.cdp/com.nepalpolice.cdp.MainActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class ImageButton
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
                                                                           at android.app.ActivityThread.access$800(ActivityThread.java:135)
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                           at android.os.Looper.loop(Looper.java:136)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:5018)
                                                                           at java.lang.reflect.Method.invokeNative(Native Method)
                                                                           at java.lang.reflect.Method.invoke(Method.java:515)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                                                                           at dalvik.system.NativeStart.main(Native Method)
                                                                        Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class ImageButton
                                                                           at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
                                                                           at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                                                                           at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                                                                           at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                                                                           at com.nepalpolice.cdp.dates.onCreateView(dates.java:36)
                                                                           at android.support.v4.app.Fragment.performCreateView(Fragment.java:2239)
                                                                           at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1332)
                                                                           at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1574)
                                                                           at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1641)
                                                                           at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:794)
                                                                           at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2415)
                                                                           at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2200)
                                                                           at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2153)
                                                                           at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2063)
                                                                           at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
                                                                           at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:554)
                                                                           at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)
                                                                           at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
                                                                           at android.app.Activity.performStart(Activity.java:5248)
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
                                                                           at android.app.ActivityThread.access$800(ActivityThread.java:135) 
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                           at android.os.Looper.loop(Looper.java:136) 
                                                                           at android.app.ActivityThread.main(ActivityThread.java:5018) 
                                                                           at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                           at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
                                                                           at dalvik.system.NativeStart.main(Native Method) 
                                                                        Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f02006b
                                                                           at android.content.res.Resources.getValue(Resources.java:1123)
                                                                           at android.support.v7.widget.ResourcesWrapper.getValue(ResourcesWrapper.java:204)
                                                                           at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:331)
                                                                           at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:196)
                                                                           at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:189)
                                                                           at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
                                                                           at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:54)
                                                                           at android.support.v7.widget.AppCompatImageButton.&lt;init&gt;(AppCompatImageButton.java:66)
                                                                           at android.support.v7.widget.AppCompatImageButton.&lt;init&gt;(AppCompatImageButton.java:56)
                                                                           at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:118)
                                                                           at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1026)
                                                                           at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1083)
                                                                           at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:172)
                                                                        at android</code></pre>
  </div>
  </div>
  </p>
  
  <p>and my fragment layout is </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>&lt;RelativeLayout 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"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      tools:context=".MainActivity"&gt;
  
  
      &lt;!--TextView and Button displayed in First Fragment --&gt;
  &lt;ImageButton android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerHorizontal="true"
      app:srcCompat="@drawable/eka"
      android:layout_marginTop="100dp"
      android:text="This is First Fragment"
      android:textSize="25sp"
      xmlns:android="http://schemas.android.com/apk/res/android" /&gt;
  
  &lt;Button
  android:id="@+id/firstButton"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:layout_centerInParent="true"
  android:layout_marginLeft="20dp"
  android:layout_marginRight="20dp"
  
  android:text="First Fragment"
  
  android:textSize="20sp"
  android:textStyle="bold" /&gt;
      &lt;/RelativeLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and my fragment class is </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package com.nepalpolice.cdp;
  
  
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentTransaction;
  import android.support.v7.app.ActionBar;
  import android.support.v7.app.AppCompatActivity;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.ImageButton;
  import android.widget.ImageView;
  import android.widget.LinearLayout;
  import android.widget.Toast;
  
  
  /**
   * Created by Sagar on 2017/09/23.
   */
  
  
  public class dates extends Fragment {
  
  
      View view;
      Button firstButton;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  // Inflate the layout for this fragment
          view = inflater.inflate(R.layout.fragment_dates, container, false);
  // get the reference of Button
          firstButton = (Button) view.findViewById(R.id.firstButton);
  // perform setOnClickListener on first Button
          firstButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  // display a message by using a Toast
                  Toast.makeText(getActivity(), "First Fragment", Toast.LENGTH_LONG).show();
              }
          });
          return view;
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>any help will be highly appreciated.</p>