Everytime I run my project (via emulator), it keeps crashing with the following error:

```
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{parking.sampleProj.testApp/parking.sampleProj.testApp.LoginActivity}: java.lang.ClassNotFoundException: Didn't find class "parking.sampleProj.testApp.LoginActivity" on path: DexPathList[[zip file "/data/app/parking.sampleProj.testApp-A8HKlv12hsjFRpN8R_O-zw==/base.apk"],nativeLibraryDirectories=[/data/app/parking.sampleProj.testApp-A8HKlv12hsjFRpN8R_O-zw==/lib/x86, /system/lib, /vendor/lib]

```

My AndroidManifest.xml looks correct, I am referencing the activity, so I don't understand why it's saying the class is not found:

```
 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"  >
    <activity android:name=".LoginActivity">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="sampleProj.testApp.MainActivity" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

```

and these are the dependencies in my gradle file:

```
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '4.0.1'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

```

My LoginActivity class is set to public. I can't understand what the issue is. Any help please?

EDIT:

Included Login Activity code and full stacktrace:

LoginActivity.java

```
package parking.sampleProj.testApp.bovparkingchecker;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class LoginActivity extends AppCompatActivity {
    private static final String TAG = "LoginActivity";
    private static final int REQUEST_SIGNUP = 0;
    private EditText username;
    private EditText password;
    private Button login_btn;
    int attempt_counter = 5;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        LoginButton();
    }

    public  void LoginButton() {
        username = (EditText)findViewById(R.id.input_email);
        password = (EditText)findViewById(R.id.input_password);
        login_btn = (Button)findViewById(R.id.btn_login);

        login_btn.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        if(username.getText().toString().equals("user") &&
                                password.getText().toString().equals("pass")  ) {
                            Toast.makeText(LoginActivity.this,"User and Password is correct",
                                    Toast.LENGTH_SHORT).show();
                            Intent intent = new Intent("parking.sampleProj.testApp.MainActivity");
                            startActivity(intent);
                        } else {
                            Toast.makeText(LoginActivity.this,"User and Password is not correct",
                                    Toast.LENGTH_SHORT).show();
                        }

                    }
                }
        );
    }
}

```

Stacktrace:

```
    --------- beginning of crash
2019-01-29 18:48:58.313 2874-2874/parking.sampleProj.testApp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: parking.sampleProj.testApp, PID: 2874
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{parking.sampleProj.testApp/parking.sampleProj.testApp.LoginActivity}: java.lang.ClassNotFoundException: Didn't find class "parking.sampleProj.testApp.LoginActivity" on path: DexPathList[[zip file "/data/app/parking.sampleProj.testApp-BNZpjysReL3uDi5HI5QYqQ==/base.apk"],nativeLibraryDirectories=[/data/app/parking.sampleProj.testApp-BNZpjysReL3uDi5HI5QYqQ==/lib/x86, /system/lib, /vendor/lib]]
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2718)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "parking.sampleProj.testApp.LoginActivity" on path: DexPathList[[zip file "/data/app/parking.sampleProj.testApp-BNZpjysReL3uDi5HI5QYqQ==/base.apk"],nativeLibraryDirectories=[/data/app/parking.sampleProj.testApp-BNZpjysReL3uDi5HI5QYqQ==/lib/x86, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.Instrumentation.newActivity(Instrumentation.java:1173)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2708)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6541) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
        Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/AppCompatActivity;
        at java.lang.VMClassLoader.findLoadedClass(Native Method)
        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
                ... 12 more
     Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatActivity" on path: DexPathList[[zip file "/data/app/parking.sampleProj.testApp-BNZpjysReL3uDi5HI5QYqQ==/base.apk"],nativeLibraryDirectories=[/data/app/parking.sampleProj.testApp-BNZpjysReL3uDi5HI5QYqQ==/lib/x86, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                ... 15 more

```