Search code examples
androidkotlinandroid-gradle-pluginandroid-instant-appskapt

Cannot choose between the following configurations of project :instant: - kapt - kaptDebug - kaptRelease


I have app with instant module, instant module has only 2 dependencies base module and one feature module. I trying to generate signed apk but i have one problem:

Cannot choose between the following configurations of project :instant:
  - kapt
  - kaptDebug
  - kaptRelease
All of them match the consumer attributes:
  - Configuration 'kapt':
      - Found artifactType 'processed-jar' but wasn't required.
      - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided.
      - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Metadata' but no value provided.
  - Configuration 'kaptDebug':
      - Found artifactType 'processed-jar' but wasn't required.
      - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided.
      - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Metadata' but no value provided.
  - Configuration 'kaptRelease':
      - Found artifactType 'processed-jar' but wasn't required.
      - Required com.android.build.api.attributes.BuildTypeAttr 'release' but no value provided.
      - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Metadata' but no value provided.

I generate apk a lot of times, but today I have this error. When I trying to go to later commits they also has this problem, but one week ago this commits working fine.

This is my instant module gradle:

apply plugin: 'com.android.instantapp'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.2'
}

dependencies {
    implementation project(':base')
    implementation project(':bo')
}

Here my feature module:

dependencies {
    implementation project(':base')
    implementation project(path: ':settings')
    implementation project(':video-player')

    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'jp.wasabeef:blurry:2.1.1'
    implementation 'com.romandanylyk:pageindicatorview:1.0.1'
    implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'

    //RxJava
    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.0'

    //time ago
    implementation 'com.github.marlonlom:timeago:3.0.2'
    //Glide
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
}

Solution

  • As @Hassan Ibraheem says problem was in apply plugin statements for kotlin-android and kotlin-android-extensions in the instantapp module. I need just remove them because this module doesn't contain any code.