title: Do partial code cache collection, code=24KB, data=30KB android studio 3.3.2
body: <p>My App freezes and crashes after adding certain dependencies to the Gradle.</p>
  
  <p><strong>Problem</strong></p>
  
  <pre><code>2019-04-15 10:17:34.573 10220-10225/com.example.app I/art: Do partial code cache collection, code=24KB, data=30KB
  2019-04-15 10:17:34.573 10220-10225/com.example.app I/art: After code cache collection, code=24KB, data=30KB
  2019-04-15 10:17:34.573 10220-10225/com.example.app I/art: Increasing code cache capacity to 128KB
  2019-04-15 10:17:34.661 10220-10220/com.example.app D/AndroidRuntime: Shutting down VM
  2019-04-15 10:17:34.683 10220-10231/? I/art: Starting a blocking GC HeapTrim
  2019-04-15 10:17:34.692 10220-10227/? I/art: Debugger is no longer active
  2019-04-15 10:17:34.692 10220-10227/? I/art: Starting a blocking GC Instrumentation
  </code></pre>
  
  <p>I have referred following answers</p>
  
  <p><a href="https://stackoverflow.com/questions/31074585/androidruntime-shutting-down-vm-with-nothing-else">&quot;AndroidRuntime: Shutting down VM&quot; with nothing else</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15257976/logcat-showing-shutting-down-vm">Logcat showing &quot;Shutting down VM&quot;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/33864168/getting-this-exception-which-forces-the-android-app-to-crash-on-start">Getting this exception which forces the android app to crash on start</a></p>
  
  <p>but none of them helped. The issue still remains the same.</p>
  
  <p><strong>Manifest.xml</strong></p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      package="com.example.app"
      android:hardwareAccelerated="false"
      android:versionCode="1"
      android:versionName="1.0"&gt;
  
      &lt;uses-permission android:name="android.permission.READ_SYNC_STATS" /&gt;
      &lt;uses-permission android:name="android.permission.GET_TASKS" /&gt;
      &lt;uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" /&gt;
      &lt;uses-permission
          android:name="android.permission.CAMERA"
          android:required="true" /&gt;
      &lt;uses-permission android:name="android.permission.DISABLE_KEYGUARD" /&gt;
  
      &lt;uses-feature android:name="android.hardware.camera" /&gt;
      &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;
      &lt;uses-feature
          android:name="android.hardware.telephony"
          android:required="false" /&gt;
  
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
      &lt;uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /&gt;
      &lt;uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /&gt;
      &lt;uses-permission android:name="android.permission.USE_CREDENTIALS" /&gt;
      &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt;
  
      &lt;uses-feature android:name="android.hardware.camera2" /&gt;
  
      &lt;application
          android:name=".sync.LogCreate"
          android:allowBackup="true"
          android:hardwareAccelerated="false"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:largeHeap="true"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".activities.ForgotPasswordActivity"&gt;&lt;/activity&gt;
          &lt;activity
              android:name=".activities.Splashscreen"
              android:label="@string/app_name"
              android:screenOrientation="portrait"&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=".activities.LoginActivity"
              android:label="@string/app_name"
              android:screenOrientation="portrait"
              android:windowSoftInputMode="adjustPan" /&gt;
          &lt;activity
              android:name=".activities.MainActivity"
              android:label="@string/app_name"
              android:screenOrientation="portrait"
              android:windowSoftInputMode="adjustPan" /&gt;
  
          &lt;service android:name=".sync.FirebaseMessageService"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
          &lt;service android:name=".sync.FirebaseInstanceIDService"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
  
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>build.gradle(app)</strong></p>
  
  <pre><code>dependencies {
  
      implementation files('libs/httpmime-4.3.6.jar')
      implementation files('libs/picasso-2.4.0.jar')
      implementation files('libs/pixlui-1-0-5.jar')
      implementation files('libs/AndroidNBioBSPJNI.jar')
      //noinspection GradleCompatible
  
      //Android Support Libraries
      implementation 'com.android.support:support-v4:27.1.1'
      implementation 'com.android.support:appcompat-v7:27.1.1'
      implementation 'com.android.support:cardview-v7:27.1.1'
      implementation 'com.android.support:design:27.1.1'
      implementation 'com.android.support:recyclerview-v7:27.1.1'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  
      implementation 'com.otaliastudios:cameraview:1.5.1'
  
      //Firebase Services
      implementation 'com.google.firebase:firebase-core:16.0.8'
      implementation 'com.google.firebase:firebase-messaging:17.6.0'
      implementation 'com.google.firebase:firebase-ml-vision:19.0.3'
      implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
      //implementation 'com.google.android.gms:play-services:12.0.1'
  
      implementation 'com.mikhaellopez:circularimageview:3.0.2'
      implementation 'com.squareup:android-times-square:1.6.5@aar'
      implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
      implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
          transitive = true;
      }
  
      implementation 'com.squareup.okhttp3:okhttp:3.2.0'
      implementation 'com.akexorcist:localizationactivity:1.2.2'
      implementation 'gun0912.ted:tedpermission-rx2:2.1.1'
  
      // JSON response handling library
      implementation 'com.google.code.gson:gson:2.8.5'
  
  }
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>Getting memoryHeap issue when adding.</p>
  
  <pre><code>implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
  </code></pre>
  
  <p>I even tried implementing the same libraries on a fresh and got no issues there.</p>
  
  <p><strong>Application.class</strong></p>
  
  <pre><code>public class LogCreate extends Application {
  
      @Override
      public void onCreate() {
          super.onCreate();
  
          Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
              @Override
              public void uncaughtException(Thread t, Throwable e) {
                  try {
                      String root = Environment.getExternalStorageDirectory().toString() + "/example";
                     FileWriter fw = new FileWriter(root + "/exception.txt", true);
                      PrintWriter pw = new PrintWriter(fw);
                      e.printStackTrace(pw);
                      Log.e("uncaughtException: ", "=" + e.getMessage());
                  } catch (Exception e1) {
                      e1.printStackTrace();
                  }
              }
          });
  
          if (isExternalStorageWritable()) {
  
              String root = Environment.getExternalStorageDirectory().toString() + "/example";
              File logDirectory = new File(root + "/log");
              File logFile = new File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt");
  
              // create log folder
              if (!logDirectory.exists()) {
                  logDirectory.mkdir();
              }
  
              // clear the previous logcat and then write the new one to the file
              try {
                  Process process = Runtime.getRuntime().exec("logcat -c");
                  process = Runtime.getRuntime().exec("logcat -f " + logFile);
              } catch (IOException e) {
                  e.printStackTrace();
              }
  
          } else if (isExternalStorageReadable()) {
              // only readable
          } else {
              // not accessible
          }
      }
  
      /*Checks if external storage is available for read and write */
      public boolean isExternalStorageWritable() {
          String state = Environment.getExternalStorageState();
          if (Environment.MEDIA_MOUNTED.equals(state)) {
              return true;
          }
          return false;
      }
  
      /*Checks if external storage is available to at least read */
      public boolean isExternalStorageReadable() {
          String state = Environment.getExternalStorageState();
          if (Environment.MEDIA_MOUNTED.equals(state) ||
                  Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
              return true;
          }
          return false;
      }
  }
  </code></pre>
  
  <p>Any help would be great.</p>
  
  <p>Thanks in advance</p>