Android 找不到Gradle DSL错误mavenCentral()

Android 找不到Gradle DSL错误mavenCentral(),android,android-studio,android-gradle-plugin,build.gradle,Android,Android Studio,Android Gradle Plugin,Build.gradle,我试图向项目中添加一些依赖项,但遇到以下错误: Error:(21, 0) Gradle DSL method not found: 'mavenCentral()' Possible causes:<ul><li>The project 'My Application' may be using a version of Gradle that does not contain the method. <a href="open.wrapper.file"

我试图向项目中添加一些依赖项,但遇到以下错误:

    Error:(21, 0) Gradle DSL method not found: 'mavenCentral()'
Possible causes:<ul><li>The project 'My Application' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>
这是另一个:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    def apiKey = project.properties['indoorAtlasApiKey'] ?: "api-key-not-set";
    def apiSecret = project.properties['indoorAtlasApiSecret'] ?: "api-secret-not-set";
    def pubNubPublishKey = project.properties['pubNubPublishKey'] ?: "not-set";
    def pubNubSubscribeKey = project.properties['pubNubSubscribeKey'] ?: "not-set";

    defaultConfig {
        applicationId "io.noxel.showroom"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        resValue "string", "indooratlas_api_key", apiKey
        resValue "string", "indooratlas_api_secret", apiSecret.replaceAll("%", "\\\\u0025")
        resValue "string", "pubnub_publish_key", pubNubPublishKey
        resValue "string", "pubnub_subscribe_key", pubNubSubscribeKey
    }
    buildTypes {
        release {
            signingConfig signingConfigs.debug
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
        lintOptions {
            abortOnError false
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.indooratlas.android:indooratlas-android-sdk:2.2.0@aar'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.maps.android:android-maps-utils:0.3.+'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.2.0'
    compile 'com.pubnub:pubnub-android:3.7.5'
    compile 'com.android.support:design:24.0.0-alpha2'
}
有人能告诉我怎么解决吗?

这个:

allprojects {
    repositories {
        mavenCentral()

    }

    mavenCentral()
    maven {
        url "http://indooratlas-ltd.bintray.com/mvn-public"
    }
}
必须更改为:

allprojects {
    repositories {
        mavenCentral()
        maven {
          url "http://indooratlas-ltd.bintray.com/mvn-public"
       } 
    }
}
这:

必须更改为:

allprojects {
    repositories {
        mavenCentral()
        maven {
          url "http://indooratlas-ltd.bintray.com/mvn-public"
       } 
    }
}
不要添加mavenCentral两次,删除存储库标记之外的一个

不要添加mavenCentral两次,删除存储库标记之外的一个


好的,谢谢,这解决了那个错误,但现在我有一个:错误:连接超时:连接。如果您使用的是HTTP代理,请在IDE或Gradle中配置代理设置。好的,谢谢,这解决了该错误,但现在我有一个错误:错误:连接超时:连接。如果您使用HTTP代理,请在IDE或Gradle中配置代理设置。
    allprojects {
        repositories {
        mavenCentral()
        maven {
            url "http://indooratlas-ltd.bintray.com/mvn-public"
          }
        }
     }