Today, Android Studio was updated, from 0.5.3 to version 0.6.1, and the result is no problem when compiling in the IDE, but the following error occurs when you compile on a command line:
: App:compiletestdebugjava Failedfailure:build failed with a exception.* what went wrong:execution failed for task ': app: Compiletestdebugjava ' .> No signature of Method:com.android.build.gradle.AppPlugin.getRuntimeJarList () is Applicable for argument types: () values: []
As I update gradle to 1.12, the problem also exists.
It seems that after the Gradle update, the unit test plugin inside is not updated. Various Google, found this address: Https://github.com/robolectric/robolectric-gradle-plugin. Then swap the original plugin for this one, modify the following (refer to the address of the Readme file): The following:
dependencies { classpath ' com.squareup.gradle:gradle-android-test-plugin:0.9.1-snapshot ' }
Modified to:
dependencies { classpath ' org.robolectric:robolectric-gradle-plugin:0.11.+ ' }
At the same time apply plugin: ' android-test ' modified to apply plugin: ' Robolectric '
Run Gradle clean build again to succeed.