2015-10-18 144 views
0

我是Gradle新手,从工作仓库下载了一个项目。Gradle不在线搜索依赖关系

当我打开项目时,Gradle无法同步。

Error:Could not find org.robobinding:codegen:0.8.9. 
Searched in the following locations: 
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/android/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.pom 
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/android/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.jar 
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/google/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.pom 
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/google/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.jarRequired by: 
GollogAndroidApp:gollog:unspecified 

根据这个日志错误,我猜测Gradle并没有在网上搜索Robobinding。我在Android Studion中查看了Gradle的离线配置工作,未检查。

这里是我的gradle.build

buildscript { 
    repositories { 
    jcenter() 
    maven() { 
     name 'RoboBinding AspectJPlugin Maven Repository' 
     url "https://github.com/RoboBinding/RoboBinding-aspectj-plugin/raw/master/mavenRepo" 
    } 
    } 
    dependencies { 
    classpath 'org.robobinding:aspectj-plugin:0.8.4' 
    classpath 'com.android.tools.build:gradle:1.1.1' 
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.6' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'org.robobinding.android-aspectj' 
apply plugin: 'com.neenbedankt.android-apt' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    lintOptions{ 
    ignoreWarnings true 
    } 

    defaultConfig { 
    applicationId "br.com.fake.fakeproject" 
    minSdkVersion 10 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
    } 
    buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    debug { 
     debuggable true 
    } 
    } 

    productFlavors { 
    dev { 
     applicationId "br.com.edeploy.fake.fakeproject" 
    } 
    prod { 
     applicationId "br.com.edeploy.fake.fakeproject" 
    } 
    } 

    packagingOptions { 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/notice.txt' 
    exclude 'META-INF/ASL2.0' 
} 
} 

ext { 
    //robobindingVersion = 'latest.integration' 
    daggerVersion = '1.2.2' 
    robobindingVersion = '0.8.9' 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.0.1' 
    compile 'info.hoang8f:android-segmented:1.0.6' 
    compile 'com.android.support:support-v4:23.0.1' 
    compile 'net.danlew:android.joda:2.8.2' 
    compile 'de.greenrobot:eventbus:2.4.0' 
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' 
    compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' 

    compile("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") { 
    exclude group: 'com.google.guava', module: 'guava' 
    } 
    aspectPath("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") { 
    exclude group: 'com.google.guava', module: 'guava' 
    } 

    apt "org.robobinding:codegen:$robobindingVersion" 
    compile 'com.google.auto.value:auto-value:1.1' 

    apt "com.squareup.dagger:dagger-compiler:$daggerVersion" 
    compile "com.squareup.dagger:dagger:$daggerVersion" 
    /*provided "org.glassfish:javax.annotation:10.0-b28"*/ 

    testCompile "junit:junit:4.12" 
    testCompile "org.mockito:mockito-all:1.10.19" 
} 

我有Android和谷歌库更新。

我正在使用Android Studio 1.4

Tks!

回答

0

您只需为您buildscript定义库 - 不为项目 - 补充一点:

repositories { 
    jcenter() 
} 

的根目录下的背后:应用插件: 'com.neenbedankt.android-容易'