无法解析配置的所有依赖项':ParseStarterProject:classpath'

时间:2016-05-27 17:13:32

标签: android parse-platform

我去更新到最新的Android Studio,现在当我去构建时,我得到以下错误。我不知道发生了什么事,也不知道如何做整个 - 如果这对我有帮助的话,那就说道。任何帮助将不胜感激。

   Executing tasks: [:ParseStarterProject:clean, :ParseStarterProject:generateDebugSources, :ParseStarterProject:prepareDebugUnitTestDependencies, :ParseStarterProject:mockableAndroidJar, :ParseStarterProject:generateDebugAndroidTestSources, :ParseStarterProject:assembleDebug]

    Configuration on demand is an incubating feature.

    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring project ':ParseStarterProject'.
    > Could not resolve all dependencies for configuration ':ParseStarterProject:classpath'.
       > Could not resolve com.parse.tools:gradle:1.+.
         Required by:
             Archive 2 2:ParseStarterProject:unspecified
          > Could not resolve com.parse.tools:gradle:1.+.
             > Failed to list versions for com.parse.tools:gradle.
                > Unable to load Maven meta-data from https://maven.parse.com/repo/com/parse/tools/gradle/maven-metadata.xml.
                   > Could not GET 'https://maven.parse.com/repo/com/parse/tools/gradle/maven-metadata.xml'.
                      > peer not authenticated

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

    BUILD FAILED

    Total time: 2.256 secs

以下是我的gradle文件

apply plugin: 'com.android.application'
apply plugin: 'com.parse'

buildscript {
  repositories {
    mavenCentral()
    maven { url 'https://maven.parse.com/repo' }
  }
  dependencies {
    classpath 'com.parse.tools:gradle:1.+'
  }
}

dependencies {
    compile 'com.parse.bolts:bolts-android:1.2.0'
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile fileTree(dir: 'libs', include: 'ParseCrashReporting-*.jar')
}

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }

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

2

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

ext {
    compileSdkVersion = 22
    buildToolsVersion = "22"

    minSdkVersion = 9
    targetSdkVersion = 22
}

2 个答案:

答案 0 :(得分:2)

这里报道的问题是: https://github.com/ParsePlatform/Parse-SDK-Android/issues/463

Parse可能已停止“托管他们的Gradle插件”。所以删除

maven { url 'https://maven.parse.com/repo' }

来自'存储库'和

classpath 'com.parse.tools:gradle:1.+'

来自'dependencies'

答案 1 :(得分:2)

删除:

  1. 申请插件:' com.parse'

  2. classpath' com.parse.tools:gradle:1。+'

  3. maven {url' https://maven.parse.com/repo' }

  4. 重建项目。一切都应该工作正常。