Android Studio 3.0 Compile Issue (Cannot choose between Configurations)

后端 未结 10 789
再見小時候
再見小時候 2020-11-30 04:34

Issue with latest 3.0 build (Beta 2) My project has 1 sub module by a 3rd party so I only have access to their build.gradle.

My project has 3 flavours, snap, uat, pr

相关标签:
10条回答
  • 2020-11-30 05:06

    for AndroidStudio 3.0+, mainMoudle has buildTypes and buildTypes as same as libModule buildTypes and buildTypes ,it would like:

    mainModule:

    buildTypes {
        release {
            buildConfigField "boolean", "LOG_DEBUG", "false"
            zipAlignEnabled true
            shrinkResources true
            minifyEnabled true
            proguardFiles 'proguard-rules.pro'
        }
    
        debug {
            buildConfigField "boolean", "LOG_DEBUG", "true"
            zipAlignEnabled true
            shrinkResources false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    
        debug2{
    
        }
    }
    

    libModule:

    buildTypes {
        release {
    
        }
    
        debug {
    
        }
    
        debug2{
    
        }
    }
    

    or you can use matchingFallbacks solve this click

    0 讨论(0)
  • 2020-11-30 05:12

    If you're using the android-apt plugin for annotation processing, try removing that plugin and replacing all of the apt some_dependency references with annotationProcessor some_dependency as suggested in the migration guide for the Android Gradle Plugin 3.0.0.

    0 讨论(0)
  • 2020-11-30 05:14

    My issue was the fact that I was renaming the output file name(and path)

    Once I've removed the gradle code that was changing the name of the aar the road to my solution was simpler.

    0 讨论(0)
  • 2020-11-30 05:17

    For me, run into the same error on Android Studio 3.5.2, with a different cause. I was trying to add an application module as a library.

    I resolved it by simply converting the application module to a library module .

    0 讨论(0)
提交回复
热议问题