How to debug "unfortunately app has stopped" in Android?
<p>I'm new to Android Programming. I'm following the guide on Android Tutorials in youtube. This for our thesis.</p>

<p>This is the MainActivity</p>

<pre><code>package com.example.abrico.violatorsprofile;

import android.content.Intent;
import android.graphics.Bitmap;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

import com.kosalgeek.android.photoutil.CameraPhoto;
import com.kosalgeek.android.photoutil.ImageLoader;

import java.io.FileNotFoundException;
import java.io.IOException;

public class MainActivity extends AppCompatActivity {

    private final String TAG = this.getClass().getName();


    ImageView ivCamera, ivImage;
    CameraPhoto cameraPhoto;

    final int CAMERA_REQUEST= 23345;
    DataBaseHelper myDb;


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

        myDb = new DataBaseHelper(this);

        //Move to TakePhoto activity
       Button btnPhoto = (Button) findViewById(R.id.btnPhoto);
        btnPhoto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              Intent intent = new Intent(getApplicationContext(),com.example.abrico.violatorsprofile.takephoto.class);
                startActivity(intent);
            }
        });



        //   Opening the camera

        ivImage = (ImageView)findViewById(R.id.ivImage);
        ivCamera = (ImageView)findViewById(R.id.ivCamera);
        cameraPhoto = new CameraPhoto(getApplicationContext());

        ivCamera.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                try {
                    startActivityForResult(cameraPhoto.takePhotoIntent(), CAMERA_REQUEST);
                    cameraPhoto.addToGallery();
                } catch (IOException e) {
                    Toast.makeText(getApplicationContext(),
                            "Some wrong while taking photos", Toast.LENGTH_SHORT).show();
                }
            }
        });
        }

    @Override //* IMAGE VIEW
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if(resultCode== RESULT_OK){
            if(requestCode==CAMERA_REQUEST){
                String photoPath = cameraPhoto.getPhotoPath();
                try {
                    Bitmap bitmap = ImageLoader.init().from(photoPath).requestSize(200,200).getBitmap();
                    ivImage.setImageBitmap(bitmap);

                }catch (FileNotFoundException e) {
                    Toast.makeText(getApplicationContext(),
                            "Some wrong while loading photos", Toast.LENGTH_SHORT).show();
                }
                Log.d(TAG, photoPath);
            }
        }










    }
    }
</code></pre>

<p>This is the Manifest</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.abrico.violatorsprofile"&gt;

    &lt;uses-feature
        android:name="android.hardware.camera2"
        android:required="true" /&gt;

    &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;

    &lt;application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"&gt;

        &lt;activity android:name=".MainActivity"&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;activity android:name=".takephoto"&gt;

        &lt;/activity&gt;


    &lt;/application&gt;

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