Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Could not determine the dependencies of task ':app:preDebugBuild'

I updated to Android Studio 3.0.1 and have this error in my console:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :libraries:Jumble:generateDebugSources, :libraries:Jumble:generateDebugAndroidTestSources, :libraries:Jumble:mockableAndroidJar]

Error:Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :libraries:Jumble.
     Required by:
         project :app
      > Cannot choose between the following configurations of project :libraries:Jumble:
          - debugRuntimeElements
          - releaseRuntimeElements
        All of them match the consumer attributes:
          - Configuration 'debugRuntimeElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' but no value provided.
              - Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
              - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but no value provided.
              - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
              - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
              - Required org.gradle.api.attributes.Usage 'java-runtime' and found compatible value 'java-runtime'.
          - Configuration 'releaseRuntimeElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' but no value provided.
              - Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
              - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but no value provided.
              - Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
              - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
              - Required org.gradle.api.attributes.Usage 'java-runtime' and found compatible value 'java-runtime'.

What caused this problem after the update?

like image 750
Slowaways Avatar asked Oct 16 '25 03:10

Slowaways


1 Answers

Fixed problem! My application did not have the build.gradle file in the root folder. I added the below and the problem has been solved:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
like image 51
Slowaways Avatar answered Oct 17 '25 16:10

Slowaways



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!