Bil*_*ksa 4 java android maven quickblox android-studio
我尝试通过添加在线maven依赖项在我的程序中使用Quickblox API.我正在使用Android Studio.
当我尝试构建我的程序时,它显示以下错误:
错误:(52,0)未找到Gradle DSL方法:`сompile()`可能的原因:项目'Nanny Watch'可能正在使用不包含该方法的Gradle版本.
打开Gradle包装文件构建文件可能缺少Gradle插件.
应用Gradle插件
这是build.gradle(Project:NannyWatch2)文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
这是build.gradle(Module:App)文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.user.nannywatch"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
def qbSdkVersion = '2.5'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.apache.commons:commons-lang3:3.4'
compile 'net.schmizz:sshj:0.10.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:multidex:1.0.0'
compile('vc908.stickers:stickerfactory:0.2.2@aar') {
transitive = true;
}
compile 'com.google.android.gms:play-services-gcm:7.5.0'
// I tried using jar compile, but the method QBPushNotifications cannot be resolved
// Therefore I tried to use the online repository
// compile files('src/main/java/com/example/user/nannywatch/jars/quickblox-android-sdk-chat-2.4.jar')
// compile files('src/main/java/com/example/user/nannywatch/jars/quickblox-android-sdk-content-2.4.jar')
// compile files('src/main/java/com/example/user/nannywatch/jars/quickblox-android-sdk-core-2.4.jar')
// compile files('src/main/java/com/example/user/nannywatch/jars/quickblox-android-sdk-customobjects-2.4.jar')
// compile files('src/main/java/com/example/user/nannywatch/jars/quickblox-android-sdk-location-2.4.jar')
// compile files('src/main/java/com/example/user/nannywatch/jars/quickblox-android-sdk-messages-2.4.jar')
// compile files('src/main/java/com/example/user/nannywatch/jars/quickblox-android-sdk-videochat-webrtc-2.4.jar')
?ompile "com.quickblox:quickblox-android-sdk-core:$qbSdkVersion@aar"
?ompile ("com.quickblox:quickblox-android-sdk-chat:$qbSdkVersion@aar"){
transitive=true
}
?ompile "com.quickblox:quickblox-android-sdk-content:$qbSdkVersion@aar"
?ompile "com.quickblox:quickblox-android-sdk-messages:$qbSdkVersion@aar"
?ompile "com.quickblox:quickblox-android-sdk-customobjects:$qbSdkVersion@aar"
?ompile "com.quickblox:quickblox-android-sdk-location:$qbSdkVersion@aar"
?ompile "com.quickblox:quickblox-android-sdk-videochat-webrtc:$qbSdkVersion@aar"
}
Run Code Online (Sandbox Code Playgroud)
还有这个警告:'dependencies'不能应用于'(groovy.lang.Closure)' Image
这是一个非常奇怪的"虫子".当您从Quickblox复制并粘贴Gradle 行时,您在单词compile中复制了字母"c"的错误ASCII代码,Gradle将无法识别单词"compile".
您可以使用以下链接自行尝试:string to ASCII
转换每个字母,您将获得不同的ASCII代码.
所以解决方案很简单,删除字母c并自己编写:)
| 归档时间: |
|
| 查看次数: |
459 次 |
| 最近记录: |