I had a bunch of test cases that worked fine. But as soon as my project was upgraded to build version 25 tools, and Java was upgraded to JDK 1.8, all of my test cases fail.
When I run my tests, I use. / gradlew cAT, I get an error message:
Toolkit error due to "java.lang.NullPointerException" com.android.builder.testing.ConnectedDevice> No tests found. [Nexus 6 - 6.0.1] FAILED
or
Tests on Nexus 6 - 6.0.1 failed: the launch of the toolkit failed due to "java.lang.ClassNotFoundException"
com.android.builder.testing.ConnectedDevice> No tests found. [Nexus 6 - 6.0.1] FAILED
My build.gradle has the following lines:
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:0.4'
androidTestCompile 'com.android.support.test:rules:0.4'
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
What idea can be solved?
Update:
When I try to run the same from gradle using. / gradlew -cAT -s, I see the following exception:
: java.lang.NoClassDefFoundError: org/ gradle/logging/ConsoleRenderer at com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask.runTests(DeviceProviderInstrumentTestTask.java:140) org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210) at org.gradle.api.internal.AbstractTask $TaskActionWrapper.execute(AbstractTask.java:621) at org.gradle.api.internal.AbstractTask $TaskActionWrapper.execute(AbstractTask.java:604) org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 68
Googling , gradle 2.14, gradle.