androidkotlinandroid-studiogradlebuild.gradle

Could not determine the dependencies of task ':app:compileProductionDebugKotlin'


I have multiple projects in my macbook. I had some gradle issues running the project. So I had changed some gradle versions and other versions and it worked fine. But all the other projects started showing issues. Please check the attached screenshot. enter image description here

This is happening with all projects I have in my mac now. Some of the dependencies aren't working now.

I tried updating the gradle version, changing java version. I have added maven, google and jcenter to gradle projects. I have made changes to graddle wrapper build and gradle properties version numbers as well but nothing seems to work.

I tried reinstalling the android studio multiple times and also installed older versions as well. I reimported the project from source control as well.

Let me know if I can do anything else.

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'dagger.hilt.android.plugin'
 apply plugin: 'com.google.gms.google-services'
 apply plugin: 'com.google.firebase.crashlytics'

 android {
compileSdkVersion 33
buildToolsVersion "30.0.3"
defaultConfig {
    applicationId "com”.sample
    minSdkVersion 26
    targetSdkVersion 33
    multiDexEnabled true
    testInstrumentationRunner 
 "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true

}
packagingOptions {
    resources.excludes.add("META-INF/*")
}
productFlavors {
    flavorDimensions "default"


}

signingConfigs {
    release {
        ….
        v2SigningEnabled true
    }

}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
    }
    debug {
   //            minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }


}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8.toString()
}

androidExtensions {
    experimental = true
}

lintOptions {
    abortOnError false
}

dataBinding {
    enabled = true
}
applicationVariants.all { variant ->
    variant.outputs.all {
        def flavor = ""
        if (variant.name == "stagingDebug") {
            flavor = "...."
        } else {
            flavor = "...."
        }

        def versionName = variant.versionName
        outputFileName = "${flavor}-${versionName}.apk"
    }
     }
    }

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31"


// SUPPORT
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.core:core-ktx:1.8.0'
// RecyclerView
implementation "androidx.recyclerview:recyclerview:1.2.1"

// CardView
implementation 'androidx.cardview:cardview:1.0.0'

// ConstraintLayout
implementation "androidx.constraintlayout:constraintlayout:2.1.4"

//Material
implementation 'com.google.android.material:material:1.5.0-alpha02'

/*    // TESTING
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'*/
implementation 'com.android.support:multidex:1.0.3'

// Scalable dimensions
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'com.google.firebase:firebase-database- 
ktx:20.0.4'
//implementation project(path: ':mediaslider')


// Mockito
testImplementation 'org.mockito:mockito-core:2.23.0'
androidTestImplementation 'org.mockito:mockito-android:2.7.22'

// LifeCycle Extensions : LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0"

// LifeCycle Extensions : ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"

// LifeCycle Extensions : Lifecycle Scope
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"

// Activity Kotlin Extension
implementation 'androidx.activity:activity-ktx:1.1.0'

// Fragment Kotlin Extension
implementation 'androidx.fragment:fragment-ktx:1.3.3'

// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.5.0'

// Dagger Hilt
implementation 'com.google.dagger:dagger:2.39.1'
annotationProcessor "com.google.dagger:dagger-compiler:2.39.1"
kapt 'com.google.dagger:dagger-compiler:2.39.1'

implementation 'com.google.dagger:hilt-android:2.37'
kapt 'com.google.dagger:hilt-android-compiler:2.37'
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03'
kapt 'androidx.hilt:hilt-compiler:1.0.0'
// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7"


// Image Picker
//implementation 'com.github.dhaval2404:imagepicker:1.7.3'

// Circular ImageView
//  implementation 'de.hdodenhof:circleimageview:3.1.0'

// Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'


// Map
/*    implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.maps.android:android-maps-utils:2.2.0'
implementation 'com.google.maps:google-maps-services:0.1.20'
implementation 'com.google.android.libraries.places:places:2.4.0'*/


implementation 'org.jetbrains.anko:anko-sdk15:0.8.2'
implementation 'com.beust:klaxon:0.30'
//    implementation 'com.google.android.gms:play-services-places:11.8.0'

// Timber Logger
implementation 'com.jakewharton.timber:timber:4.7.1'

// Phone Number
//   implementation 'io.michaelrocks:libphonenumber-android:8.10.16'

// Broadcast manager
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

//Country code picker
implementation 'com.hbb20:ccp:2.4.0'

// Firebase Auth
implementation 'com.google.firebase:firebase-auth-ktx:19.4.0'
implementation 'com.google.android.gms:play-services-auth:18.1.0'


//Nested RecyclerView
implementation 'com.github.rubensousa:gravitysnaphelper:2.1.0'

implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
//implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
//implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'io.reactivex:rxandroid:1.2.0'
implementation 'io.reactivex:rxjava:1.1.8'

//Stripe Payment sdk
//implementation 'com.stripe:stripe-android:16.3.1'
implementation 'com.squareup.okhttp3:okhttp:4.5.0'
//implementation 'com.google.android.gms:play-services-wallet:18.1.1'

implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'

//pubnub
// implementation 'com.pubnub:pubnub-kotlin:5.1.0'
//implementation group: 'com.pubnub', name: 'pubnub-gson', version: '4.20.0'.


implementation 'com.google.firebase:firebase-core:16.0.1'
// Firebase Messaging library for sending push notifications. 
 Add this line.
implementation 'com.google.firebase:firebase-messaging:17.3.3'
// PubNub Android SDK. Add this line.
//implementation group: 'com.pubnub', name: 'pubnub-gson', version: '4.20.0'

//crashLytics
implementation platform('com.google.firebase:firebase-bom:26.1.0')
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation platform('com.google.firebase:firebase-bom:26.1.0')
implementation 'com.google.firebase:firebase-analytics'
implementation("com.google.firebase:firebase-config")


//in app update
//implementation 'com.google.android.play:core:1.6.4'
//implementation 'javax.xml.bind:jaxb-core:2.2.11'
//analytics
//implementation 'com.google.android.gms:play-services-analytics:17.0.0'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180830.0359'

//glide image transformation
implementation 'jp.wasabeef:glide-transformations:3.0.1'
implementation 'com.github.dhaval2404:imagepicker:1.7.3'
implementation 'com.android.support:design:26.1.0'

// implementation project(':pdfcreator')

//notification counter
//  implementation 'com.nex3z:notification-badge:1.0.4'

implementation('com.journeyapps:zxing-android-embedded:4.2.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'


//  implementation 'com.github.Gkemon:Android-XML-to-PDF-Generator:2.6.2'

compile fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.github.vipulasri.layouttoimage:library:1.0.0'
implementation 'id.zelory:compressor:3.0.1'
implementation("androidx.activity:activity-ktx:1.5.1")
implementation 'pub.devrel:easypermissions:3.0.0'

implementation 'id.zelory:cekrek:1.0.0'
//  implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'


//  implementation 'com.github.barteksc:android-pdf- 
  viewer:3.2.0-beta.1'

// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.11'

implementation("org.greenrobot:eventbus:3.3.1")

implementation 'com.nex3z:notification-badge:1.0.4'

//websocket
implementation 'tech.gusavila92:java-android-websocket-client:1.2.2'

//calender
implementation 'io.github.architshah248.calendar:awesome-calendar:2.0.0'

// Add the dependency for the Performance Monitoring library
// When using the BoM, you don't specify versions in Firebase 
library dependencies
implementation("com.google.firebase:firebase-perf")


}

Solution

  • After many months of R&D I found that these dependencies were not available in JCENTER which is now deprecated in newer versions. We needed to update these dependencies however, these were not updated so I had to find a replacement for these. I used methods for some dependencies where I can. For dependencies which are absolutely necessary, you can simply add the project files to that Android project directory and implement them inside the project directly. Hope this helps someone else.