Unable to start activity ComponentInfo ( java.lang.RuntimeException )
<p>This error has appeared on this forum millions of time but I really could not find the answer to resolve this error! I am using Navigation drawer with fragments, so far I have incorporated(I think I have) a countdown timer and a google map. I don't know what the problem is I have tried "almost" every solution mentioned on the internet for this error.</p>

<p>ERROR:</p>

<pre><code>    01-26 15:10:47.923: E/AndroidRuntime(3731): FATAL EXCEPTION: main
01-26 15:10:47.923: E/AndroidRuntime(3731): Process: com.example.TheWeddingApp, PID: 3731
01-26 15:10:47.923: E/AndroidRuntime(3731): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.TheWeddingApp/com.example.TheWeddingApp.MainActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.example.navigationdrawer.FragmentOne: make sure class name exists, is public, and has an empty constructor that is public
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.ActivityThread.access$800(ActivityThread.java:139)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.os.Handler.dispatchMessage(Handler.java:102)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.os.Looper.loop(Looper.java:136)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.ActivityThread.main(ActivityThread.java:5086)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at java.lang.reflect.Method.invokeNative(Native Method)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at java.lang.reflect.Method.invoke(Method.java:515)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at dalvik.system.NativeStart.main(Native Method)
01-26 15:10:47.923: E/AndroidRuntime(3731): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.example.navigationdrawer.FragmentOne: make sure class name exists, is public, and has an empty constructor that is public
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.support.v4.app.Fragment.instantiate(Fragment.java:401)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.support.v4.app.Fragment.instantiate(Fragment.java:369)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at com.example.TheWeddingApp.MainActivity.onCreate(MainActivity.java:54)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.Activity.performCreate(Activity.java:5248)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
01-26 15:10:47.923: E/AndroidRuntime(3731):     ... 11 more
01-26 15:10:47.923: E/AndroidRuntime(3731): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.navigationdrawer.FragmentOne" on path: DexPathList[[zip file "/mnt/asec/com.example.TheWeddingApp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.TheWeddingApp-1/lib, /vendor/lib, /system/lib]]
01-26 15:10:47.923: E/AndroidRuntime(3731):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
01-26 15:10:47.923: E/AndroidRuntime(3731):     at android.support.v4.app.Fragment.instantiate(Fragment.java:391)
01-26 15:10:47.923: E/AndroidRuntime(3731):     ... 16 more
</code></pre>

<p>Manifest.xml</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.TheWeddingApp"
android:versionCode="1"
android:versionName="1.0" &gt;

&lt;permission
    android:name="com.example.TheWeddingApp.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" /&gt;

&lt;uses-permission android:name="com.example.TheWeddingApp.permission.MAPS_RECEIVE" /&gt;


&lt;uses-sdk
    android:minSdkVersion="13"
    android:targetSdkVersion="17" /&gt;

&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
&lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;

&lt;!-- Required to show current location --&gt;
&lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
&lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
&lt;uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" /&gt;

&lt;application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" &gt;
    &lt;activity
        android:name="com.example.TheWeddingApp.MainActivity"
        android:label="@string/app_name" &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;meta-data
 android:name="com.google.android.maps.v2.API_KEY"
 android:value="AIzaSyBTbyjkzYDeEFGsljSoLBr54riAjhWCVJg" /&gt;

&lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<p>MainActivity.java</p>

<pre><code>package com.example.TheWeddingApp;
import android.app.ActionBar;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.widget.DrawerLayout;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends FragmentActivity {
    final String[] data ={"Home","Venue","Gallery","Meet the Groom","Meet `the Bride"};`
    final String[] fragments ={
        "com.example.navigationdrawer.FragmentOne",
        "com.example.navigationdrawer.FragmentTwo",
        "com.example.navigationdrawer.FragmentThree",
        "com.example.navigationdrawer.FragmentFour",
        "com.example.navigationdrawer.FragmentFive"};
@Override
protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);

     ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getActionBar().getThemedContext(), android.R.layout.simple_list_item_1, data);
     ActionBar bar = getActionBar();
     bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ff0000")));

     final DrawerLayout drawer = (DrawerLayout)findViewById(R.id.drawer_layout);
     final ListView navList = (ListView) findViewById(R.id.drawer);
     navList.setAdapter(adapter);
     navList.setOnItemClickListener(new OnItemClickListener(){
             @Override
             public void onItemClick(AdapterView&lt;?&gt; parent, View view, final int pos,long id){
                     drawer.setDrawerListener( new DrawerLayout.SimpleDrawerListener(){
                             @Override
                             public void onDrawerClosed(View drawerView){
                                     super.onDrawerClosed(drawerView);
                                     FragmentTransaction tx = getSupportFragmentManager().beginTransaction();
                                     tx.replace(R.id.main, Fragment.instantiate(MainActivity.this, fragments[pos]));
                                     tx.commit();
                             }
                     });
                     drawer.closeDrawer(navList);
             }
     });
     FragmentTransaction tx = getSupportFragmentManager().beginTransaction();
     tx.replace(R.id.main,Fragment.instantiate(MainActivity.this, fragments[0]));
     tx.commit();
}

}
</code></pre>

<p>activity_main.xml</p>

<pre><code>    &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" &gt;

    &lt;FrameLayout
        android:id="@+id/main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" &gt;
    &lt;/FrameLayout&gt;

    &lt;ListView
        android:id="@+id/drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#ff0000"
        android:choiceMode="singleChoice"/&gt;

&lt;/android.support.v4.widget.DrawerLayout&gt;
</code></pre>

<p>FragmentOne.java </p>

<pre><code>    package com.example.TheWeddingApp; 
import java.text.SimpleDateFormat;
import java.util.Date;    
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.NavUtils;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

public class FragmentOne extends Fragment {

    private TextView tvDay, tvHour, tvMinute, tvSecond, tvEvent;
    private LinearLayout linearLayout1, linearLayout2;
    private Handler handler;
    private Runnable runnable;

    public static Fragment newInstance(Context context) {
        FragmentOne f = new FragmentOne();
        return f;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_one, null);
        getActivity().setContentView(R.layout.fragment_one);
        initUI();
        countDownStart();
        return root;
    }


    @SuppressLint("SimpleDateFormat")
    private void initUI() {
        linearLayout1 = (LinearLayout) getActivity().findViewById(R.id.ll1);
        linearLayout2 = (LinearLayout) getActivity().findViewById(R.id.ll2);
        tvDay = (TextView) getActivity().findViewById(R.id.txtTimerDay);
        tvHour = (TextView) getActivity().findViewById(R.id.txtTimerHour);
        tvMinute = (TextView) getActivity().findViewById(R.id.txtTimerMinute);
        tvSecond = (TextView) getActivity().findViewById(R.id.txtTimerSecond);
        tvEvent = (TextView) getActivity().findViewById(R.id.tvevent);
    }


    public void countDownStart() {
        handler = new Handler();
        runnable = new Runnable() {
            @Override
            public void run() {
                handler.postDelayed(this, 1000);
                try {
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            "yyyy-MM-dd");
                    // Here Set your Event Date
                    Date futureDate = dateFormat.parse("2016-2-19");
                    Date currentDate = new Date();
                    if (!currentDate.after(futureDate)) {
                        long diff = futureDate.getTime()
                                - currentDate.getTime();
                        long days = diff / (24 * 60 * 60 * 1000);
                        diff -= days * (24 * 60 * 60 * 1000);
                        long hours = diff / (60 * 60 * 1000);
                        diff -= hours * (60 * 60 * 1000);
                        long minutes = diff / (60 * 1000);
                        diff -= minutes * (60 * 1000);
                        long seconds = diff / 1000;
                        tvDay.setText("" + String.format("%02d", days));
                        tvHour.setText("" + String.format("%02d", hours));
                        tvMinute.setText("" + String.format("%02d", minutes));
                        tvSecond.setText("" + String.format("%02d", seconds));
                    } else {
                        linearLayout1.setVisibility(View.VISIBLE);
                        linearLayout2.setVisibility(View.GONE);
                        tvEvent.setText("Android Event Start");
                        handler.removeCallbacks(runnable);
                        // handler.removeMessages(0);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        };
        handler.postDelayed(runnable, 0);
    } 

}
</code></pre>

<p>fragment_one.xml</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" &gt;

 &lt;LinearLayout
     android:id="@+id/ll1"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_centerHorizontal="true"
     android:layout_marginTop="10dp"
     android:background="#000000"
     android:gravity="center|center_horizontal|center_vertical"
     android:orientation="horizontal"
     android:visibility="gone" &gt;

        &lt;TextView
            android:id="@+id/tvevent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal|center_vertical"
            android:singleLine="true"
            android:text="Android Event Start"
            android:textColor="#fff"
            android:textSize="24sp"
            android:textStyle="bold" /&gt;
    &lt;/LinearLayout&gt;

    &lt;LinearLayout
        android:id="@+id/ll2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_gravity="center"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="10dp"
        android:background="#000000"
        android:gravity="center|center_horizontal|center_vertical"
        android:orientation="horizontal"
        android:visibility="visible" &gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="#000000"
            android:gravity="center"
            android:orientation="vertical" &gt;

            &lt;TextView
                android:id="@+id/txtTimerDay"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:gravity="center"
                android:text="00"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:textColor="#fff" /&gt;

            &lt;TextView
                android:id="@+id/txt_TimerDay"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:text="Days"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#fff" /&gt;
        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="#000000"
            android:gravity="center"
            android:orientation="vertical" &gt;

            &lt;TextView
                android:id="@+id/txtTimerHour"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:gravity="center"
                android:text="00"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:textColor="#fff" /&gt;

            &lt;TextView
                android:id="@+id/txt_TimerHour"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:text="Hour"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#fff" /&gt;
        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="#000000"
            android:gravity="center"
            android:orientation="vertical" &gt;

            &lt;TextView
                android:id="@+id/txtTimerMinute"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:gravity="center"
                android:text="00"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:textColor="#fff" /&gt;

            &lt;TextView
                android:id="@+id/txt_TimerMinute"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:text="Minute"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#fff" /&gt;
        &lt;/LinearLayout&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="#000000"
            android:gravity="center"
            android:orientation="vertical" &gt;

            &lt;TextView
                android:id="@+id/txtTimerSecond"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:gravity="center"
                android:text="00"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:textColor="#fff" /&gt;

            &lt;TextView
                android:id="@+id/txt_TimerSecond"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:text="Second"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="#fff" /&gt;
        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;


&lt;/RelativeLayout&gt;
</code></pre>

<p>FragmentTwo.java</p>

<pre><code>    package com.example.TheWeddingApp;


import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

public class FragmentTwo extends Fragment {

    private GoogleMap googleMap;



    public static Fragment newInstance(Context context) {
        FragmentTwo f = new FragmentTwo();

        return f;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_two, null);
        getActivity().setContentView(R.layout.fragment_two);

        try {
            // Loading map
            initilizeMap();

        } catch (Exception e) {
            e.printStackTrace();
        }
        return root;
    }

    private void initilizeMap() {
        if (googleMap == null) {
            googleMap = ((MapFragment) getActivity().getFragmentManager().findFragmentById(R.id.map)).getMap();

            // check if map is created successfully or not
            if (googleMap == null) {
                Toast.makeText(getActivity().getApplicationContext(),
                        "Sorry! unable to create maps", Toast.LENGTH_SHORT)
                        .show();
            }
        }
    }
    @Override
    public void onResume() {
        super.onResume();
        initilizeMap();
    }

}
</code></pre>

<p>fragment_two.xml</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" &gt;

    &lt;fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/&gt;
&lt;/RelativeLayout&gt;
</code></pre>