Cometchat SDK not importing

Commetchat SDK isn’t importing into my project in android studio, I’m getting this error “ERROR: Failed to resolve: com.cometchat:pro-android-chat-sdk:2.0.3”

Hello @Hamsoft
Can you please comfirm if you have added the download Url to the project level gradle file as mentioned in the below link

If this does not solve the problem…please share your gradle files with us so that we can have a look.

Thanks

apply plugin: ‘com.android.application’

apply plugin: ‘kotlin-kapt’

apply plugin: ‘kotlin-android’

apply plugin: ‘kotlin-android-extensions’

apply plugin: ‘io.fabric’

/configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == ‘org.jetbrains.kotlin’ && requested.name == ‘kotlin-reflect’) {
details.useVersion kotlin_version
}
}
}
/

android {
compileSdkVersion 29
buildToolsVersion “29.0.2”
defaultConfig {
buildConfigField “String”, “API_KEY”, "

    applicationId "com.*****.android.*****"
    minSdkVersion 21
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
dataBinding {
    enabled true
}

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

}

dependencies {
def lifecycle_version = “2.2.0”
def room_version = “2.2.5”
def daggerVersion = “2.24”

kapt "androidx.room:room-compiler:$room_version"

api "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"

//dagger-android
api "com.google.dagger:dagger-android:$daggerVersion"
api "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"

implementation "androidx.room:room-runtime:$room_version"

// For Kotlin use kapt instead of annotationProcessor

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha02'

implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha06'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava’s latest version for bug fixes and new features.
// (see https://github.com/ReactiveX/RxJava/releases for latest 2.x.x version)
implementation ‘io.reactivex.rxjava2:rxkotlin:2.3.0’
implementation ‘com.google.firebase:firebase-analytics:17.3.0’
//

//Paging
implementation 'androidx.paging:paging-runtime:2.1.0'

implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'

implementation 'com.squareup.picasso:picasso:2.71828'

implementation 'com.squareup.okhttp3:logging-interceptor:4.2.0'

// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'

//circle imageview
implementation 'de.hdodenhof:circleimageview:3.0.1'

//image loading lib
implementation 'com.squareup.picasso:picasso:2.71828'
//chatkit implementation

/* implementation ‘com.pusher:chatkit-android:1.8.0’
implementation ‘com.github.stfalcon:chatkit:0.3.3’*/

//implementation 'com.cometchat:pro-android-chat-sdk:2.0.4-beta1'

//ImageViews
implementation 'com.github.siyamed:android-shape-imageview:0.9.3'

//Utils
implementation 'me.relex:circleindicator:1.2.2@aar'

implementation "org.jetbrains.kotlin:kotlin-reflect:1.1.0"

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

// implementation ‘com.cometchat:pro-android-chat-sdk:2.0.4-beta1’
implementation ‘com.cometchat:pro-android-chat-sdk:2.0.3’

}

apply plugin: ‘com.google.gms.google-services’

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = ‘1.3.61’
repositories {
google()
jcenter()
maven {
url ‘https://maven.fabric.io/public

        }

    maven {
        url "https://dl.bintray.com/cometchat/pro"
    }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.4.2'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.2'
    classpath 'io.fabric.tools:gradle:1.31.0'  // Crashlytics plugin
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
jcenter()
}
}
/dependencies {
implementation “org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version”
}
/

task clean(type: Delete) {
delete rootProject.buildDir
}

Hello @Hamsoft
Can you please move the below code:

maven {
url “https://dl.bintray.com/cometchat/pro
}

From the buildscript section to the allprojects section

That should resolve the issue.
In case you still face the issue, please get back to us

Thanks

Yeah Fixed the issue, thank you very much.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.