Android Studio 1.3:测试模块未进入模块窗口

时间:2015-09-12 10:23:26

标签: android testing android-studio

我在1.3.2中更新了android studio。和gradle插件也是1.3.0 但点击文件 - >新 - >模块。窗口正在打开,但android studio测试模块中的最新更新未显示

1 个答案:

答案 0 :(得分:0)

您可以手动创建类似

的结构
[esi + esp*4]

创建一个文件夹,例如root app build.gradle testmodule build.gradle build.gradle settings.gradle

testmodule 中创建:

testmodule

testmodule build.gradle src main java com.mycompany.package.test 中,您可以执行以下操作:

testmodule.build.gradle

apply plugin: 'com.android.test' android { compileSdkVersion XX buildToolsVersion = '23.0.0' defaultConfig { minSdkVersion ... targetSdkVersion .. // The package name of the test app testApplicationId 'com.mycompany.package.test' // The Instrumentation test runner used to run tests. testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' } // Set the target app project. The module specified here should contain the production code // test should run against. targetProjectPath ':app' targetVariant 'flavor1Debug' } dependencies { // Android Testing Support Library's runner and rules and hamcrest matchers compile 'com.android.support.test:runner:0.3' compile 'com.android.support.test:rules:0.3' compile 'org.hamcrest:hamcrest-core:1.3' } 中添加模块。

settings.gradle

确保使用插件1.3和gradle 2.5

在您的顶级include ':app' include ':testmodule'

build.gradle

classpath 'com.android.tools.build:gradle:1.3.0'

gradle/wrapper/gradle-wrapper.properties