title: problems with main actvity
body: <p>whenever i try to launch the app it crushes so my logcat displays this</p>
  
  <blockquote>
    <p>logcat</p>
  </blockquote>
  
  <pre><code>2019-02-22 03:08:15.442 7022-7022/com.example.whatsappclone E/LoadedApk: Unable to instantiate appComponentFactory
      java.lang.ClassNotFoundException: Didn't find class "com.example.whatsappclone.whateverString" on path: DexPathList[[zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/base.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_resources_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/lib/x86, /system/lib]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
          at android.app.LoadedApk.createAppFactory(LoadedApk.java:226)
          at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:731)
          at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
          at android.app.LoadedApk.getResources(LoadedApk.java:1032)
          at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
          at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5749)
          at android.app.ActivityThread.access$1100(ActivityThread.java:199)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:193)
          at android.app.ActivityThread.main(ActivityThread.java:6669)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
          Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_resources_apk.apk
          at dalvik.system.DexFile.openDexFileNative(Native Method)
          at dalvik.system.DexFile.openDexFile(DexFile.java:354)
          at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:101)
          at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:75)
          at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
          at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
          at dalvik.system.DexPathList.&lt;init&gt;(DexPathList.java:164)
          at dalvik.system.BaseDexClassLoader.&lt;init&gt;(BaseDexClassLoader.java:74)
          at dalvik.system.BaseDexClassLoader.&lt;init&gt;(BaseDexClassLoader.java:65)
          at dalvik.system.PathClassLoader.&lt;init&gt;(PathClassLoader.java:64)
          at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
          at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
          at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
          at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
          at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
                  ... 12 more
  2019-02-22 03:08:16.142 7022-7022/com.example.whatsappclone E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.whatsappclone, PID: 7022
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.whatsappclone/com.example.whatsappclone.MainActivity}: android.view.InflateException: Binary XML file line #12: Binary XML file line #12: Error inflating class android.support.design.widget.AppBarLayout
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:193)
          at android.app.ActivityThread.main(ActivityThread.java:6669)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
       Caused by: android.view.InflateException: Binary XML file line #12: Binary XML file line #12: Error inflating class android.support.design.widget.AppBarLayout
       Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class android.support.design.widget.AppBarLayout
       Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.AppBarLayout" on path: DexPathList[[zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/base.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_resources_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/lib/x86, /system/lib]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
          at android.view.LayoutInflater.createView(LayoutInflater.java:606)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
  2019-02-22 03:08:16.145 7022-7022/com.example.whatsappclone E/AndroidRuntime:     at com.example.whatsappclone.MainActivity.onCreate(MainActivity.java:44)
          at android.app.Activity.performCreate(Activity.java:7136)
          at android.app.Activity.performCreate(Activity.java:7127)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:193)
          at android.app.ActivityThread.main(ActivityThread.java:6669)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
          Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.example.whatsappclone-8dz68hsI19AuFX5Ytae9HA==/split_lib_resources_apk.apk
          at dalvik.system.DexFile.openDexFileNative(Native Method)
          at dalvik.system.DexFile.openDexFile(DexFile.java:354)
          at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:101)
          at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:75)
          at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
          at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
          at dalvik.system.DexPathList.&lt;init&gt;(DexPathList.java:164)
          at dalvik.system.BaseDexClassLoader.&lt;init&gt;(BaseDexClassLoader.java:74)
          at dalvik.system.BaseDexClassLoader.&lt;init&gt;(BaseDexClassLoader.java:65)
          at dalvik.system.PathClassLoader.&lt;init&gt;(PathClassLoader.java:64)
          at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
          at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
          at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
          at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
          at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
          at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
          at android.app.LoadedApk.getResources(LoadedApk.java:1032)
          at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
          at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5749)
          at android.app.ActivityThread.access$1100(ActivityThread.java:199)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
                  ... 6 more
  </code></pre>
  
  <p>so the line 44 of the main activity which appears to have the error but i cant understand it really the line 44 itself is  </p>
  
  <pre><code>setContentView(R.layout.activity_main);
  </code></pre>
  
  <p>so the main activity itself is here below</p>
  
  <blockquote>
    <p>MainActivity</p>
  </blockquote>
  
  <pre><code>package com.example.whatsappclone;
  
  import android.content.DialogInterface;
  import android.content.Intent;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AlertDialog;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.appcompat.widget.Toolbar;
  
  import androidx.viewpager.widget.ViewPager;
  
  import android.os.Bundle;
  
  import android.text.TextUtils;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.EditText;
  import android.widget.Toast;
  
  import com.google.android.gms.tasks.OnCompleteListener;
  import com.google.android.gms.tasks.Task;
  import com.google.android.material.tabs.TabLayout;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseUser;
  import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.database.ValueEventListener;
  
  public class MainActivity extends AppCompatActivity {
      private Toolbar mToolbar;
      private ViewPager myViewPager;
      private TabLayout myTablayout;
      private TabsAccessorAdapter myTabAccessorAdapter;
      private FirebaseUser currentUser;
      private FirebaseAuth mAuth;
      private DatabaseReference RootRef;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mAuth = FirebaseAuth.getInstance();
          currentUser = mAuth.getCurrentUser();
          RootRef = FirebaseDatabase.getInstance().getReference();
  
          myTablayout = (TabLayout)findViewById(R.id.main_tabs);
          myTablayout.setupWithViewPager(myViewPager);
  
          myViewPager = (ViewPager) findViewById(R.id.main_tabs_pager);
          myTabAccessorAdapter = new TabsAccessorAdapter(getSupportFragmentManager());
          myViewPager.setAdapter(myTabAccessorAdapter);
  
  
          mToolbar = (Toolbar) findViewById(R.id.main_page_toolbar);
          setSupportActionBar(mToolbar);
          getSupportActionBar().setTitle("WhatsAppClone");
      }
  
      @Override
      protected void onStart() {
          super.onStart();
  
          if (currentUser == null)
          {
              SendUserToLoginActivity();
          }
          else{
              VerifyUserExistance();
          }
      }
  
      private void VerifyUserExistance() {
          String currentUserID = mAuth.getCurrentUser().getUid();
          RootRef.child("Users").child(currentUserID).addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                if ((dataSnapshot.child("name").exists()))
                {
                    Toast.makeText(MainActivity.this, "Welcome", Toast.LENGTH_SHORT).show();
                }
                else{
                   SendUserToSettingsActivity();
                }
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
  
              }
          });
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
           super.onCreateOptionsMenu(menu);
  
          getMenuInflater().inflate(R.menu.options_menu, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
           super.onOptionsItemSelected(item);
           if (item.getItemId()==R.id.main_logout_option){
             mAuth.signOut();
             SendUserToLoginActivity();
           }
          if (item.getItemId()==R.id.main_settings_option){
              SendUserToSettingsActivity();
          }
          if (item.getItemId()==R.id.main_create_group_option){
              RequestNewGroup();
          }
  
          if (item.getItemId()==R.id.main_find_friends_option){
  
          }
          return true;
      }
  
      private void RequestNewGroup() {
          AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this, R.style.AlertDialog);
          builder.setTitle("Enter Group Name :");
  
          final EditText groupNameField = new EditText(MainActivity.this);
          groupNameField.setHint("e.g Class Of 2K14");
          builder.setView(groupNameField);
  
          builder.setPositiveButton("Create", new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  String groupName = groupNameField.getText().toString();
  
                  if (TextUtils.isEmpty(groupName)){
                      Toast.makeText(MainActivity.this, "Please write Group name...", Toast.LENGTH_SHORT).show();
                  }else{
                    CreateNewGroup(groupName);
                  }
              }
          });
  
          builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                  dialog.cancel();
              }
          });
  
          builder.show();
  
      }
  
      private void CreateNewGroup(final String groupName) {
          RootRef.child("Groups").child(groupName).setValue("")
                  .addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
                      @Override
                      public void onComplete(@NonNull Task&lt;Void&gt; task) {
                          if (task.isSuccessful()){
                              Toast.makeText(MainActivity.this, groupName +"group is successfully created", Toast.LENGTH_SHORT).show();
                          }
                      }
                  });
  
      }
  
  
      private void SendUserToLoginActivity() {
          Intent loginIntent = new Intent(MainActivity.this, LoginActivity.class);
          loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
          startActivity(loginIntent);
          finish();
      }
  
      private void SendUserToSettingsActivity() {
          Intent settingsIntent = new Intent(MainActivity.this, SettingsActivity.class);
          settingsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
          startActivity(settingsIntent);
          finish();
      }
  }
  </code></pre>
  
  <p>Also below is the activity_main Xml</p>
  
  <blockquote>
    <p>Activity_main.xml</p>
  </blockquote>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"
      android:background="@color/colorAccent"&gt;
  
  
     &lt;android.support.design.widget.AppBarLayout
         android:id="@+id/appBarLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"&gt;
  
  
        &lt;include
            layout="@layout/app_bar_layout"
            android:id="@+id/main_page_toolbar"
            &gt;
        &lt;/include&gt;
  
        &lt;android.support.design.widget.TabLayout
            android:id="@+id/main_tabs"
            android:layout_width="match_parent"
            android:layout_height="12sp"
            android:theme="@style/Base.ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
        &lt;/android.support.design.widget.TabLayout&gt;
  
     &lt;/android.support.design.widget.AppBarLayout&gt;
  
     &lt;androidx.core.view.ViewPager
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/main_tabs_pager"
         android:layout_below="@+id/appBarLayout"&gt;
  
        &lt;android.support.v4.view.PagerTabStrip
            android:id="@+id/pager_title_strip"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_gravity="top"
            android:background="@color/colorPrimary"
            android:textColor="#fff"
            android:paddingBottom="5dp" &gt;
  
        &lt;/android.support.v4.view.PagerTabStrip&gt;
  
     &lt;/androidx.core.view.ViewPager&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>