无法将Android Studio与Maven存储库同步

Mar*_*coz 0 java android gradle maven android-studio

我正在尝试将此库添加到我的项目中:

但是Android Studio返回此错误:

错误:(8,13)无法解决:com.github.castorflex.smoothprogressbar:library:1.1.0

错误:(6,13)无法解决:com.loopj.android:android-async-http:1.4.6

错误:(7,13)无法解决:com.google.apis:google-api-services-analytics:v3-rev115-1.20.0

这是我的build.grade文件:

apply plugin: 'com.android.application'


dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':librarySmartHotel')
    compile 'com.loopj.android:android-async-http:1.4.6'
    compile 'com.google.apis:google-api-services-analytics:v3-rev115-1.20.0'
    compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
    compile 'com.google.android.gms:play-services:6.5.87'
}

android {
    compileSdkVersion 19
    buildToolsVersion "22.0.1"

    defaultConfig {
        multiDexEnabled true
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}
Run Code Online (Sandbox Code Playgroud)

我必须配置一些东西吗?例如com.google.android.gms:play-services:6.5.87运行完美,我没有做任何配置。

任何帮助将不胜感激。

CRO*_*OSP 5

首先,尝试将build.gradle以下代码添加到您的Project 文件中,或仅将其添加到现有存储库中

repositories {
        mavenCentral()
    }
Run Code Online (Sandbox Code Playgroud)

另外,您可能已"Offline mode"启用。检查是否File -> Build,Execution,Deployment-> Maven/Gradle "Offline work"已启用,如果已启用,则将其禁用Sync Gradle

让我知道结果。