Alexei
Alexei

Reputation: 15666

Circular dependency between the following tasks:

in my android app:

in app/build.gradle:

dependencies {
    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'

    implementation project(':fointeraction')  
    implementation project(':reports')
    implementation project(':transport')

in module transport transport/build.gradle:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.0.2'
    api 'com.squareup.okhttp3:logging-interceptor:3.8.0'
    api "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
    api "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"


    implementation project(':fointeraction')

Module fointeraction use module transport and visa versa

in module fointeraction

fointeraction/build.gradle:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:28.0.0'
    api 'com.google.code.gson:gson:2.8.5'
    api 'commons-io:commons-io:2.6' // "api" configurations will be transitively exposed to consumers of the library
    implementation 'commons-codec:commons-codec:1.12'
    implementation 'org.apache.commons:commons-lang3:3.8.1'
    implementation 'org.apache.httpcomponents:httpclient:4.5.8'

    implementation project(':transport')

When I try build I get error:

Circular dependency between the following tasks:
:fointeraction:compileDebugAidl
\--- :transport:compileDebugAidl
     \--- :fointeraction:compileDebugAidl (*)

(*) - details omitted (listed previously)

Upvotes: 1

Views: 9366

Answers (3)

Khyati Vara
Khyati Vara

Reputation: 1060

circular references means - you would have added the main app as a library to child module which you have created.

Like added implemented app module in another child or feature module.

If added then remove then dependency from feature module gradle file and it will be resolved error.

Upvotes: 1

Brandon McAnsh
Brandon McAnsh

Reputation: 1031

Your fointeraction includes transport which includes fointeraction which includes transport (and on and on and on)

Upvotes: 2

Shalu T D
Shalu T D

Reputation: 4039

I suggest one solution but don't know it may be helpful. Please remove implementation 'com.android.support:appcompat-v7:28.0.0' from fointeraction/build.gradle file and use implementation 'androidx.appcompat:appcompat:1.0.2' instead. It's better to use AndroidX library throughout the project instead of using separate.

Upvotes: 0

Related Questions