2

everyone! I'm new in android, and I wasted the day, looking for solution. I added Quickblox GCM to my app, and when I tried to to build projects, Gradle says:

Error:(71, 1) A problem occurred evaluating project ':app'. Could not find method сompile() for arguments [com.quickblox:quickblox-android-sdk-chat:3.3.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

That is my app/gradle.build:

> buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    //Crashlytics
    maven { url 'https://maven.fabric.io/public'
    }
    //Mockito
    jcenter()
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'

//Crashlytics
compile ('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
    transitive = true;
}

// Retrofit
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'

//RxAndroid
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'

//Quickblox
сompile "com.quickblox:quickblox-android-sdk-chat:$rootProject.qbSdkVersion"
сompile "com.quickblox:quickblox-android-sdk-messages:$rootProject.qbSdkVersion"

And this is root gradle.build:

    buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
        }
    }
}

ext {
    qbSdkVersion = '3.3.0'
}

I did all this, due to instruction on http://quickblox.com/developers/Android#How_to:_add_SDK_to_IDE_and_connect_to_the_cloud

Koroqe
  • 67
  • 7
  • Possible duplicate of [Error:(52, 0) Gradle DSL method not found: 'сompile()' in using Quickblox API](https://stackoverflow.com/questions/35415847/error52-0-gradle-dsl-method-not-found-%d1%81ompile-in-using-quickblox-api) – Cœur Dec 08 '18 at 15:40

1 Answers1

4

Replace

сompile "com.quickblox:quickblox-android-sdk-chat:$rootProject.qbSdkVersion"
сompile "com.quickblox:quickblox-android-sdk-messages:$rootProject.qbSdkVersion"

With

compile("com.quickblox:quickblox-android-sdk-chat:2.6.1")
nipun.birla
  • 719
  • 5
  • 19
  • Holy.... ! I tried many ways, but not this one. Thanks! You're awesome! – Koroqe Jan 26 '17 at 17:09
  • Not really, just added what the documentation link you shared said! ;) – nipun.birla Jan 26 '17 at 17:11
  • But in their repo latest code sample showed: `def qbSdkVersion = '3.3.0' dependencies { // сompile "com.quickblox:quickblox-android-sdk-chat:$qbSdkVersion"` – Koroqe Jan 26 '17 at 17:12