使用Gradle Android构建系统测试依赖关系不会更新Android Studio * .iml文件

时间:2014-12-04 16:18:50

标签: android gradle android-studio

在将build.gradle与androidTestCompile依赖项同步时,我不明白,它不会更新myproject.iml文件。

enter image description here

正如你在我的build.gradle上看到的,我有我的依赖:

dependencies {

androidTestCompile 'org.assertj:assertj-core:1.7.0' 
}

我使用香精

productFlavors {
    pro {
        applicationId = 'com.myapp.pro'
        testApplicationId 'com.myapp.pro.test'
    }
    free {
        applicationId = 'com.myapp.free'
        testApplicationId 'com.myapp.free.test'
    }
}

但是在iml文件中,我期待这样的条目,但我什么都没有:

<orderEntry type="library" exported="" scope="TEST" name="assertj-core-1.7" level="project" />

我使用android studio 1.0 RC 2和最近的插件com.android.tools.build:gradle:1.0.0-rc2

编辑:

如果我从build.gradle中删除了flavor块,则iml会由Android Studio正确生成。

1 个答案:

答案 0 :(得分:0)

找出问题,我必须从Android Studio中选择正确的变体,iml文件将会更新。

On the bottom left, you see "Build Variants" button, click on it, a new panel will appear and you will able to choose your variant

在左下方,您会看到&#34; Build Variants&#34;按钮,单击它,将出现一个新面板,您将能够选择您的变体