2016-09-14 64 views
0

我一些研究,我已經得到了它是用來做很酷intros.It的GitHub的項目之後做一個介紹我app.So解決任何新的依賴,需要以下相關:gradle這個是不是在Android Studio中

compile 'com.github.paolorotolo:appintro:4.0.0' 

當我gradle這個編譯它,它給了我以下錯誤:

Failed to resolve: com.github.paolorotolo:appintro:4.0.0 

我已經做互聯網上的一些研究,但任何事情沒有解決。

這裏是我的build.gradle(Module:app)

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 24 
buildToolsVersion "24.0.1" 

defaultConfig { 
    applicationId "com.example.adarsh.testapp" 
    minSdkVersion 16 
    targetSdkVersion 24 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:24.2.0' 
compile 'com.android.support:support-v4:24.2.0' 
compile 'com.github.paolorotolo:appintro:4.0.0' 
} 

,這裏是我的build.gradle(project:testapp)

// 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:2.1.3' 

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
} 
allprojects { 
repositories { 
    jcenter() 
    } 
} 
task clean(type: Delete) { 
delete rootProject.buildDir 
} 
+0

檢查您的連接。任何防火牆或代理可能會阻止你? – Henry

+0

您是否啓用了離線工作? –

+0

@GKTHEBOSS不,它被禁用 – Adarsh

回答

0

我解決我的問題,通過在倉庫中build.gradle只是增加mavenCentral()