title: java.lang.IllegalStateException: failed to analyze: java.lang.reflect.InvocationTargetException
body: <p>Android studio gave error</p>
  <blockquote>
  <p>java.lang.IllegalStateException: failed to analyze:<br />
  java.lang.reflect.InvocationTargetException</p>
  </blockquote>
  <p>it was working fine on Windows os and
  i imported code to macos and i can't run it anymore<br />
  tried changing kotlin version<br />
  tried changing gradle version<br />
  nothing seems to work</p>
  <p>My Gradle file</p>
  <pre><code>plugins {
      id 'com.android.application'
      id 'kotlin-android'
      id 'kotlin-android-extensions'
      id 'kotlin-kapt'
  }
  
  android {
      compileSdk 30
      buildToolsVersion &quot;30.0.3&quot;
  
      defaultConfig {
          applicationId &quot;com.nrp.sbja&quot;
          minSdk 21
          targetSdk 30
          versionCode 1
          versionName &quot;1.0&quot;
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
          dataBinding {
              enabled = true
          }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  }
  
  dependencies {
  
      implementation 'androidx.appcompat:appcompat:1.2.0'
      implementation 'com.google.android.material:material:1.3.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
      testImplementation 'junit:junit:4.+'
      androidTestImplementation 'androidx.test.ext:junit:1.1.2'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
  
  
  
      def room_version = &quot;2.2.6&quot;
      implementation &quot;androidx.room:room-runtime:$room_version&quot;
      annotationProcessor &quot;androidx.room:room-compiler:$room_version&quot;
      implementation &quot;androidx.room:room-rxjava2:$room_version&quot;
      implementation &quot;androidx.room:room-guava:$room_version&quot;
      testImplementation &quot;androidx.room:room-testing:$room_version&quot;
  
  
      kapt 'com.android.databinding:compiler:3.1.4'
  
      
  
      kapt &quot;androidx.room:room-compiler:$room_version&quot;
      
  
  }
  
  apply plugin: 'kotlin-kapt'
  apply plugin: 'com.google.gms.google-services'
  apply plugin: 'com.google.firebase.crashlytics'
  '''
  
  
  project level gradle- 
  '''
  // Top-level build file where you can add configuration options common to all sub-projects/modules.
  buildscript {
      ext.kotlin_version = '1.3.21'
      repositories {
          google()
          mavenCentral()
      }
      dependencies {
          // classpath &quot;com.android.tools.build:gradle:7.1.0-alpha02&quot;
          classpath &quot;com.android.tools.build:gradle:4.1.3&quot;
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
          // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
          classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
  
          classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.0'
          classpath 'com.google.gms:google-services:4.3.8'
  
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  
  allprojects {
      repositories {
          google()
          jcenter()
          mavenCentral()
          maven { url 'https://jitpack.io' }
          /* maven {
              url 'http://dl.bintray.com/amulyakhare/maven'
          }*/
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  
  </code></pre>