Android 缺少与Gradle的依赖关系?

Android 缺少与Gradle的依赖关系?,android,intellij-idea,gradle,Android,Intellij Idea,Gradle,我正在为一个Android项目做准备,这个项目似乎是由Gradle管理的 老实说,我对格雷德尔是个十足的新手,所以我正在慢慢准备 下面是我的gradle包装器的输出: C:\Users\Daniel\Projects\JustSingIt-Android [feature/no-newrelic +0 ~1 -0]> .\gradlew --info Starting Build Settings evaluated using settings file 'C:\Users\Daniel

我正在为一个Android项目做准备,这个项目似乎是由Gradle管理的

老实说,我对格雷德尔是个十足的新手,所以我正在慢慢准备

下面是我的gradle包装器的输出:

C:\Users\Daniel\Projects\JustSingIt-Android [feature/no-newrelic +0 ~1 -0]> .\gradlew --info
Starting Build
Settings evaluated using settings file 'C:\Users\Daniel\Projects\JustSingIt-    Android\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\Daniel\Projects\JustSingIt-Android\build.gradle'.
Included projects: [root project 'JustSingIt-Android', project ':JustSingIt']
Evaluating root project 'JustSingIt-Android' using build file 'C:\Users\Daniel\Projects\JustSingIt-Android\build.grad'.
Evaluating project ':JustSingIt' using build file 'C:\Users\Daniel\Projects\JustSingIt-Android\JustSingIt\build.gradl'
Compiling build file 'C:\Users\Daniel\Projects\JustSingIt-  Android\JustSingIt\build.gradle' using BuildScriptClasspathiptTransformer.
Compiling build file 'C:\Users\Daniel\Projects\JustSingIt-Android\JustSingIt\build.gradle' using BuildScriptTransform

Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed Gradle 2.0
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/android/volley/volley/1.0/volley-1.0.pom]
Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/com/android/volley/volley/1.0/volley-1.0.jar]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/readystatesoftware/android-simpl3r/maven-metadata.xml]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/readystatesoftware/android-simpl3r/]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/readystatesoftware/android-simpl3r/maven-metadata.xml]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/readystatesoftware/android-simpl3r/]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/handmark/pulltorefresh/library/2.1.1/library-2.1.1.pom
Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/com/handmark/pulltorefresh/library/2.1.1/library-2.1.1.ja
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/facebook/android/facebook-sdk/maven-metadata.xml]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/facebook/android/facebook-sdk/]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/facebook/android/facebook-sdk/maven-metadata.xml]
Resource missing. [HTTP GET: http://repo1.maven.org/maven2/com/facebook/android/facebook-sdk/]

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':JustSingIt'.
> Could not resolve all dependencies for configuration ':JustSingIt:_debugCompile'.
   > Could not find com.android.volley:volley:1.0.
     Required by:
         JustSingIt-Android:JustSingIt:unspecified
   > Could not find any version that matches com.readystatesoftware:android-simpl3r:1.0+.
     Required by:
         JustSingIt-Android:JustSingIt:unspecified
   > Could not find com.handmark.pulltorefresh:library:2.1.1.
     Required by:
         JustSingIt-Android:JustSingIt:unspecified
   > Could not find any version that matches com.facebook.android:facebook-sdk:0.1+.
     Required by:
         JustSingIt-Android:JustSingIt:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
这是我的gradle文件:

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.7+'
        classpath 'com.newrelic.agent.android:agent-gradle-plugin:2.433.0'
    }
}
apply plugin: 'android'
//apply plugin: 'newrelic'

repositories {
    mavenCentral()
    mavenLocal()
}

android {
    compileSdkVersion 18
    buildToolsVersion '19.0.1'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19

        buildConfigField "boolean", "ACRA_ENABLE", 'true'
        buildConfigField "boolean", "API_FAKE_ENABLE", 'true'
    }

    buildTypes {
        stage {
            versionName
            versionNameSuffix 'S'
            debuggable true
            packageNameSuffix '.stage'

        }
        dev {
            versionNameSuffix 'D'
            debuggable true
            packageNameSuffix '.dev'
        }
        release {
            debuggable true
    }

}

dependencies {
        repositories()
        compile fileTree(dir: 'libs', include: '*.jar')

        // Google Play Services
        compile 'com.google.android.gms:play-services:3.2+'

        compile 'com.android.volley:volley:1.0'

        compile 'com.squareup:otto:1.3+'

        compile('com.google.code.gson:gson:2.2+') {
            exclude group: 'org.json'
        }

        compile 'com.googlecode.libphonenumber:libphonenumber:3.1+'

        compile 'ch.acra:acra:4.5+'

        compile 'com.squareup.okhttp:okhttp:1.2+'
        compile 'com.jakewharton:butterknife:3.0+'
        compile 'com.android.support:appcompat-v7:18.0.0'
        compile 'com.readystatesoftware:android-simpl3r:1.0+'

       // New Relic removed.
      //  compile 'com.newrelic.agent.android:android-agent:2.433.0'


//        compile 'com.origamilabs.library:StaggeredGridView:1.0+'
        compile 'net.hockeyapp.android:HockeySDK:3.0.1'

        compile("com.handmark.pulltorefresh:library:2.1.1") {
            exclude group: 'com.android.support'
        }

        compile('com.facebook.android:facebook-sdk:0.1+') {
            exclude group: 'com.android.support'
        }
    }
}
有什么想法吗?谢谢

编辑:新发行

好的,现在的问题是,在构建(.\gradlew build)期间,我得到了很多与类路径中找不到的库相关的错误。我还手动将AmazonAWSSDK添加到项目中,但我得到了相同的错误。唯一似乎安装正确的库是Facebook

这是我的最新版本。gradle:

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
    }    

    dependencies {
        classpath 'com.android.tools.build:gradle:0.7+'
        classpath 'com.newrelic.agent.android:agent-gradle-plugin:2.433.0'
    }
}
apply plugin: 'android'
//apply plugin: 'newrelic'    

repositories {
    mavenCentral()
    mavenLocal()
}    

android {
    compileSdkVersion 18
    buildToolsVersion '19.0.1'    

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19    

        buildConfigField "boolean", "ACRA_ENABLE", 'true'
        buildConfigField "boolean", "API_FAKE_ENABLE", 'true'
    }    

    buildTypes {
        stage {
            versionName
            versionNameSuffix 'S'
            debuggable true
            packageNameSuffix '.stage'    

        }
        dev {
            versionNameSuffix 'D'
            debuggable true
            packageNameSuffix '.dev'
        }
        release {
            debuggable true
    }    

}    

dependencies {
        repositories()
        compile fileTree(dir: 'libs', include: '*.jar')
        compile fileTree(dir: 'libraries', include: '*.jar')
        compile project(':libraries:facebook')
        compile 'com.google.android.gms:play-services:3.2+'         // Google Play Services
        compile 'com.mcxiaoke.volley:library:1.0+'                  // <- Volley-Mirror, a mirror of volley,
        compile 'com.squareup:otto:1.3+'
        compile 'com.googlecode.libphonenumber:libphonenumber:3.1+'
        compile 'ch.acra:acra:4.5+'
        compile 'com.squareup.okhttp:okhttp:1.2+'
        compile 'com.jakewharton:butterknife:3.0+'
        compile 'com.android.support:appcompat-v7:18.0.0'
        compile 'com.github.manuelpeinado.refreshactionitem:library:1.0+'
        compile 'net.hockeyapp.android:HockeySDK:3.0.1'
        compile('com.google.code.gson:gson:2.2+') {
            exclude group: 'org.json'
        }
        compile('com.github.chrisbanes.pulltorefresh:parent:2.1+') {
            exclude group: 'com.android.support'
        }    

    // New Relic removed.
//        compile 'com.newrelic.agent.android:android-agent:2.433.0'    

//        compile 'com.origamilabs.library:StaggeredGridView:1.0+'    

//        compile('com.facebook.android:facebook-sdk:0.1+') {
//            exclude group: 'com.android.support'
//        }
    }
}
buildscript{
存储库{
mavenCentral()
mavenLocal()
}    
依赖关系{
classpath'com.android.tools.build:gradle:0.7+'
classpath'com.newrelic.agent.android:agent gradle插件:2.433.0'
}
}
应用插件:“android”
//应用插件:“newrelic”
存储库{
mavenCentral()
mavenLocal()
}    
安卓{
编译DK18版
buildToolsVersion“19.0.1”
默认配置{
明斯克版本14
targetSdkVersion 19
buildConfigField“布尔”、“ACRA_启用”、“真”
buildConfigField“boolean”、“API\u FAKE\u ENABLE”、“true”
}    
建筑类型{
舞台{
版本名
版本名称uffix'S'
可调试真
packageNameSuffix“阶段”
}
发展{
版本名称uffix'D'
可调试真
packageNameSuffix'.dev'
}
释放{
可调试真
}    
}    
依赖关系{
存储库()
编译文件树(目录:“libs”,包括:“*.jar”)
编译文件树(目录:“库”,包括:“*.jar”)
编译项目(“:库:facebook”)
编译'com.google.android.gms:play services:3.2+'//谷歌播放服务

编译'com.mcxiaoke.volley:library:1.0+'/并非每个库都在Maven Central repository中可用。有时,您必须将其他库添加到您的构建中,或者自己构建项目并发布到本地Maven repo

com.android.volley
-在Maven Central中不可用,但您可以自己构建并推送到本地Maven存储库,也可以使用发布到Maven Central的project

com.facebook.android
-您必须安装它才能在项目中使用。说明可用

com.mandwark.pulltorefresh
-发布到Maven Central的


com.readystatesoftware.android-simple3r
-与上面一样,它发布到Maven Central下

为什么要使用'com.android.tools.build:gradle:0.7+'?最新版本是'0.8+'。@IgorGanapolsky修复。该死的“复制粘贴”:D