简体   繁体   中英

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. (OneSignal)

I cloned the project and getting the above mentioned error. The code was running okay but I suddenly getting these errors.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.onesignal:OneSignal:3.16.0: Skipped due to earlier error

I tried everything to resolve it, downloaded gradle files again, did "Flutter clean" and restarted android studio by invalidating caches but I do not understand why gradle sync started is failing to update them.I am using "gradle-5.4.1-all". Below is my build.gradle file.

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://plugins.gradle.org/m2/' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Can anybody help me to resolve these please? Thanks.

This error was related to oneSignal Server. It was down. Android Gradle download few dependencies if you close or restart your Android studio. Because server was down and dependencies were not downloaded therefore it started throwing an error. Sometimes it is also due to internet connection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM