Unable to switch to debug build variant in Android Studio

后端 未结 16 722
不知归路
不知归路 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 15:21

    I just had the same issue. Solved it by closing Android Studio, removing the generated files and folders: .gradle, .idea, app/.externalNativeBuild, app/build, build, app/app.iml, ProjectName.iml, local.properties, then relaunching Android Studio and allowing it regenerate all these files from scratch.

    0 讨论(0)
  • 2021-02-01 15:22

    Open your module setting. (Click F4)

    Go to build types and create a new Build by clicking on plus(+) sign.

    Name it anything, like "demo".

    Duplicate all the data of debug build.

    Now when you open Build Variant you will be able to switch to Debug as well as Demo.

    0 讨论(0)
  • 2021-02-01 15:24

    English is not my native language; please excuse typing errors.

    I also meet this situation. i do this to solv .
    Solv:
    1. delete each module's impl suffix type file and build folder;
    2. then click this button to sync project with gradle build file. button position

    finally. and then this problem will be fix.

    0 讨论(0)
  • 2021-02-01 15:25

    For me, it was an issue with the gradle version. Make sure your plugin version and the required gradle version fit together, as defined here.

    https://developer.android.com/studio/releases/gradle-plugin

    You can find out which gradle versions you are using under:

    File -> Project Structure... -> Project

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