Gradle compilation error: Execution failed for task ': App:compiletestdebugjava '.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.