摇篮同步失败。基本功能无法正常使用

时间:2019-01-02 12:20:47

标签: android highcharts build.gradle

运行项目时,出现gradle同步失败错误。

以下是错误:
org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException:无法HEAD'http://repo.pageturner-reader.org/com/highsoft/highcharts/highcharts/6.1.4/highcharts-6.1.4.pom'。从服务器收到状态码403:禁止<35内部呼叫>

以下是完整的错误消息:

    Executing tasks: [assembleDebug]

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
:app:preBuild UP-TO-DATE
:app:preDebugBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.osbcp.cssparser:cssparser:1.5.
  Required by:
      project :app
   > Could not resolve com.osbcp.cssparser:cssparser:1.5.
      > Could not get resource 'http://repo.pageturner-reader.org/com/osbcp/cssparser/cssparser/1.5/cssparser-1.5.pom'.
         > Could not GET 'http://repo.pageturner-reader.org/com/osbcp/cssparser/cssparser/1.5/cssparser-1.5.pom'. Received status code 403 from server: Forbidden

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

* Get more help at https://help.gradle.org

BUILD FAILED in 17s

我的顶级构建文件是

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'https://maven.google.com' }
        maven { url "https://highsoft.bintray.com/Highcharts"}
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath 'io.fabric.tools:gradle:1.25.1'
        classpath "io.realm:realm-gradle-plugin:2.2.0"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}


这是我的应用程序级别build.gradle文件内容。

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        google()
        maven {
            url "https://maven.google.com"
            name 'Google'
        }
        maven {
            url "http://repo.pageturner-reader.org"
        }
        maven {
            url "https://highsoft.bintray.com/Highcharts"
        }
        maven {
            url "https://jitpack.io"
        }
        jcenter()
    }
}

请帮助我解决此问题。

2 个答案:

答案 0 :(得分:0)

您提到的错误消息并不详细。要详细检查错误,请单击右侧的 Gradle 标签-> 应用->双击 assembleDebug

答案 1 :(得分:0)

还请提供应用程序级别build.gradle,可能与此处的存储库/依赖项配置有关。