Unable to switch to debug build variant in Android Studio

后端 未结 16 942
不知归路
不知归路 2021-02-01 14:22

I\'ve switched to release build variant and configured signingConfigs. Now when I try to check the debug build variant from the drop down menu it switches immediately back to th

16条回答
  •  渐次进展
    2021-02-01 14:59

    Unrelated to your build.gradle file,

    Sharing hoping it might help someone else -

    I was having similar issue it was because one of the line in build.gradle -

    android {
        ...
        publishNonDefault true // remove this line and it should work!
    }
    

    Here you can get more detail about publishNonDefualt -


    It is also possible to publish all variants of a library. We are planning to allow this while using a normal project-to-project dependency (like shown above), but this is not possible right now due to limitations in Gradle (we are working toward fixing those as well). Publishing of all variants are not enabled by default. The snippet below enables this feature:


提交回复
热议问题