I am trying to run my testng tests through gradle on Android studio. I have source code and tests placed in the gradle file using unitTest gradle feature. So to use the test task i have to apply java plugin but android studio is giving me an error saying "Java plugin is not compatible with android plugins". I know android and java plugins are not compatible with each other, but is there any solution for it? This is my build.gradle looks like
apply plugin: 'com.android.application'
apply plugin: 'java'
dependencies {
// Android Support Library
compile 'com.android.support:support-v4:21.0.3'
androidTestCompile 'org.testng:testng:6.8.7'
androidTestCompile 'dom4j:dom4j:1.6.1'
androidTestCompile 'org.seleniumhq.selenium:selenium-server:2.44.0'
androidTestCompile 'jaxen:jaxen:1.1.6'
androidTestCompile 'io.appium:java-client:2.2.0'
}
test {
useTestNG()
//options.suites("src/androidTest/res/groups.xml")
}