Location map crash in OnePlus One device : <p>my application got crash in OnePlus one device. Following is the details of device</p>

<p>Oneplus One(A0001)</p>

<p>Cyanogen 13.1- ZNH2KAS1KN </p>

<p>Android 6.0.1</p>

<p>Api Elderberry (5) </p>

<p>And logcat shows error</p>

<blockquote>
  <p>Unable to start activity
  ComponentInfo{com.test/com.test.DetailsActivity}:
  android.view.InflateException: Binary XML file line #108: Binary XML
  file line #108: Error inflating class fragment -- Stack Trace --
  java.lang.RuntimeException: Unable to start activity
  ComponentInfo{com.test/com.test.DetailsActivity}:
  android.view.InflateException: Binary XML file line #108: Binary XML
  file line #108: Error inflating class fragment at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
  at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
  at android.app.ActivityThread.-wrap11(ActivityThread.java) at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
  at android.os.Handler.dispatchMessage(Handler.java:102) at
  android.os.Looper.loop(Looper.java:148) at
  android.app.ActivityThread.main(ActivityThread.java:5461) 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: android.view.InflateException: Binary XML file line #108: Binary
  XML file line #108: Error inflating class fragment at
  android.view.LayoutInflater.inflate(LayoutInflater.java:539) at
  android.view.LayoutInflater.inflate(LayoutInflater.java:423) at
  android.view.LayoutInflater.inflate(LayoutInflater.java:374) at
  android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppComapatDelegateImplV7.java:256)
  at
  android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
  at com.test.DetailsActivity.onCreate(DetailsActivity.java:313) at
  android.app.Activity.performCreate(Activity.java:6251) at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
  at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
  ... 9 more Caused by: android.view.InflateException: Binary XML file
  line #108: Error inflating class fragment at
  android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
  at
  android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) at
  android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at
  android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at
  android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at
  android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
  at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) at
  android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
  at android.view.LayoutInflater.inflate(LayoutInflater.java:515) ... 17
  more Caused by: android.content.res.Resources$NotFoundException: File
  /data/system/theme/icons/com.test_7f030000_0.png from drawable
  resource ID #0x7f030000 at
  android.content.res.Resources.openRawResource(Resources.java:1336) at
  android.content.res.Resources.openRawResource(Resources.java:1306) at
  maps.V.N.a(Unknown Source) at maps.D.e.a(Unknown Source) at
  maps.D.p.a(Unknown Source) at maps.ad.ae.a(Unknown Source) at
  maps.ad.t.a(Unknown Source) at maps.ad.M.a(Unknown Source) at
  wd.onTransact(:com.google.android.gms.DynamiteModulesB:107) at
  android.os.Binder.transact(Binder.java:387) at
  com.google.android.gms.maps.internal.IMapFragmentDelegate$zza$zza.onCreateView(Unknown
  Source) at
  com.google.android.gms.maps.SupportMapFragment$zza.onCreateView(Unknown
  Source) at com.google.android.gms.dynamic.zza$4.zzb(Unknown Source) at
  com.google.android.gms.dynamic.zza.zza(Unknown Source) at
  com.google.android.gms.dynamic.zza.onCreateView(Unknown Source) at
  com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown
  Source) at
  com.test.fragments.CustomMapFragment.onCreateView(CustomMapFragment.java:39)
  at
  android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
  at
  android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1036)
  at
  android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1226)
  at
  android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1328)
  at
  android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2284)
  at
  android.support.v4.app.FragmentController.onCreateView(FragmentController.java:111)
  at
  android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:314)
  at
  android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:31)
  at
  android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:79)
  at
  android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:754)
  ... 29 more Caused by: java.io.FileNotFoundException:
  /data/system/theme/icons/com.test_7f030000_0.png at
  android.content.res.AssetManager.openNonAssetNative(Native Method) at
  android.content.res.AssetManager.openNonAsset(AssetManager.java:423)
  at android.content.res.Resources.openRawResource(Resources.java:1333)
  ... 55 more</p>
</blockquote>

<p>I have added the map fragment in the layout file</p>

<pre><code>  &lt;fragment
          android:id="@+id/fragment_map"
          android:name="com.test.fragments.CustomMapFragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:tag="fragment_map" /&gt;


public class CustomMapFragment extends SupportMapFragment {

    private OnTouchListener mListener;

    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View layout = super.onCreateView(inflater, container, savedInstanceState);
        TouchableWrapper frameLayout = new TouchableWrapper(getActivity());
        ((ViewGroup) layout).addView(frameLayout,
                new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        return layout;
    }

    public void setListener(OnTouchListener listener) {
        mListener = listener;
    }

    public interface OnTouchListener {
        void onTouch();
    }

    public class TouchableWrapper extends FrameLayout {

        public TouchableWrapper(Context context) {
            super(context);
        }

        @Override
        public boolean dispatchTouchEvent(MotionEvent event) {
            switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    mListener.onTouch();
                    break;
                case MotionEvent.ACTION_UP:
                    mListener.onTouch();
                    break;
            }
            return super.dispatchTouchEvent(event);
        }
    }
}
</code></pre>

<p>Let me know if anyone face the same issue and found any solution to fix this crash.</p>
