Gradle "Could not find method сompile() for arguments",设置 Quickblox
Gradle "Could not find method сompile() for arguments", setting up Quickblox
各位!我是 android 的新人,我浪费了一天时间寻找解决方案。我将 Quickblox GCM 添加到我的应用程序,当我尝试构建项目时,Gradle 说:
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.
那是我的 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"
这是根 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'
}
由于 http://quickblox.com/developers/Android#How_to:_add_SDK_to_IDE_and_connect_to_the_cloud
上的说明,我做了所有这些
替换
сompile "com.quickblox:quickblox-android-sdk-chat:$rootProject.qbSdkVersion"
сompile "com.quickblox:quickblox-android-sdk-messages:$rootProject.qbSdkVersion"
有
compile("com.quickblox:quickblox-android-sdk-chat:2.6.1")
各位!我是 android 的新人,我浪费了一天时间寻找解决方案。我将 Quickblox GCM 添加到我的应用程序,当我尝试构建项目时,Gradle 说:
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.
那是我的 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"
这是根 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'
}
由于 http://quickblox.com/developers/Android#How_to:_add_SDK_to_IDE_and_connect_to_the_cloud
上的说明,我做了所有这些替换
сompile "com.quickblox:quickblox-android-sdk-chat:$rootProject.qbSdkVersion"
сompile "com.quickblox:quickblox-android-sdk-messages:$rootProject.qbSdkVersion"
有
compile("com.quickblox:quickblox-android-sdk-chat:2.6.1")