Android studio gradle依赖项未加载

时间:2015-03-07 19:55:59

标签: android-studio gradle android-gradle build.gradle

我正在使用Android Studio开发Android应用程序,我使用Gradle来处理构建。当我尝试编译调试项目时,我发现一些库没有找到错误。这些库包含在build.gradle文件中,应该通过gradle链接。由于在编译时没有找到库,我认为这些文件没有通过gradle正确链接。

任何人都可以查看配置文件并查找其中的任何错误吗?感谢:

buildscript {
repositories {
    maven { url 'http://repo1.maven.org/maven2' }
    mavenCentral()
}
dependencies {
    //classpath 'com.android.tools.build:gradle:0.6.+'
    classpath 'com.android.tools.build:gradle:1.1.0'
}
}
apply plugin: 'android'

repositories {
    maven {
        url 'https://github.com/Goddchen/mvn-repo/raw/master/'
    }
    mavenCentral()
}

dependencies {
    compile 'com.android.support:support-v4:13.0.0'
    compile 'com.google.android.gms:play-services:3.1.36'
    compile 'com.google.code.gson:gson:2.2.4'
    //compile 'com.codeslap:persistence:0.9.24'
    compile 'org.apache.commons:commons-io:1.3.2'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.8.4'
    //compile 'com.facebook.android:facebook:3.5.2'
    compile 'com.facebook.android:facebook:3.17.1'
    compile files('libs/rollbar-android-0.0.6.jar')
    compile files('libs/libGoogleAnalyticsV2.jar')
    //compile files('libs/commons-codec-1.7-SNAPSHOT-android.jar')
    compile files('libs/tinylinetry_and.jar')
}

android {
    compileSdkVersion 18
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 18
    }

    signingConfigs {
        release {
            storeFile file("../keystore.jks")
            storePassword "******"
            keyAlias "Android Release Key"
            keyPassword "******"
        }
    }

    buildTypes {
        debug {
            applicationIdSuffix ".debug"
        }
        release {
            signingConfig signingConfigs.release
        }
    }
}

我得到的错误来自这种:

:app:compileDebugJava
.../Application.java:55: error: package com.rollbar.android does not exist
import com.rollbar.android.Rollbar;

....

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

因此,所有已加载且应该被gradle包含的外部库都找不到。

0 个答案:

没有答案