What Product Flavor does Android Studio build by default in build.gradle?

社会主义新天地 提交于 2019-11-28 03:21:31

On the lower left of the Studio window there's a docked view called "Build Variants".

Open it and choose whichever variant you want to work on. This will impact which variant is built but also the enabled source folders, which will drive completion in code and resources editors.

Currently there appears to be no way to select default flavor. There is a feature request in Android Issue Tracker for it:

https://code.google.com/p/android/issues/detail?id=64917

You can star/vote the request, so it gets higher priority on Android development tools backlog.

user3556812

The ability to specify a default build variant has just been added, see feature request:

"Included in Android Gradle Plugin 3.5.0-alpha08 and Android Studio 3.5 Canary 8 [3.5.0.7].

The heuristic for projects using older AGP and projects without explicit settings has also been updated to favour variants with the build type debug, as described in the commit message."

You can specify the command run In Section Before launch Gradle-aware Make

You can list all gradle tasks by gradlew tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!