Android的Studio项目与口味,来源蓝色未显示目录 [英] Android Studio project with flavors, Sources directory not shown in blue color

查看:576
本文介绍了Android的Studio项目与口味,来源蓝色未显示目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Android的摇篮项目,我想创建2味分公司,我使用默认sourceSet与结构如下图

i have android gradle project and i want to create 2 flavor branches, i use default sourceSet with structure as below

src
  - main
    - java
      - package   
    - res
    - manifest.xml

  - flavor1
    - java
      - package

  - flavor2
    - java
      - package

主/ java中,flavor1 / Java的标记源(蓝色),但flavor2也没有标志。我试图清除缓存和重新启动的工作室,但它并不能帮助。我该如何解决这个问题?

main/java, flavor1/java marks as source (blue color), but flavor2 has not mark. I tried clear caches and restart studio but its doesn't help. How can I fix this?

推荐答案

您主目录(内容根)来源将永远是蓝色的默认颜色的,但其他人依赖于积极性。

Your main directory(content root) sources will always be blue colored by default, But others depend on the activeness .

在蓝色的目录显示,该构建变量或内容根是活动的,如果你将使用IDE的运行按钮录音室将这些资源来编译和构建你的应用程序。只有一个内容根可以同时启动建设的应用程序。

The blue color directory shows that this build variant or content root is active and if you will use the Run button of IDE the studio will take these sources to compile and build you app. Only one content root can be active at a time for building the app.

您可以更改,使任何目录/香味激活您的内容根编译和构建应用程序时使用运行选项。它可以做的 构建变体 在你的Andr​​oid工作室的左侧面板中可用选项卡。

You can change and make any directory/flavor active for your content root to compile and build your app when run option is used. It can be done from Build Variants tab available in left panel of your Android Studio.

像显示在下面的图片:

生产是这里活跃的:

production is active here:

UAT是这里活跃的:

uat is active here:

这篇关于Android的Studio项目与口味,来源蓝色未显示目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆