I am trying Intellij 16 EAP and I can't properly import an android project in it. The robolectric tests are not recognized as part of the project
The project I am importing is a sample project that can be found on github:
https://github.com/robolectric/deckard
This is the build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
repositories {
jcenter()
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 18
targetSdkVersion 23
versionCode 2
versionName "1.0.0-SNAPSHOT"
applicationId "com.example"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
packagingOptions {
exclude 'LICENSE.txt'
}
}
dependencies {
// Support v4
compile 'com.android.support:support-v4:23.1.1'
// Espresso
androidTestCompile 'com.android.support:support-annotations:23.1.1'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
// Robolectric
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' // fixes issue on linux/mac
testCompile 'org.robolectric:robolectric:3.0'
}
Any clues on why this is happening ?
Edit: 1) If I remove all the android plugin from gradle and I just add the java plugin, instantly recognizes the unit tests and adds them to project. Then as soon as I switch back to android plugin, intellij deletes it again. 2) I tried Intellij 15 and Android Studio 2.0 and I am getting the same results