dinsdag 10 juni 2014

Robolectric and Android Studio 0.6.0

Quite recently a new update on Android Studio (version 0.6.0) was released. With the new release also came an upgrade of Gradle. Unfortunately the upgrade breaks your Robolectric testing if you use the gradle-android-test-plugin.

I did hope that the plugin team would release a quick-fix, but at the time of writing, this still isn't the case.

You can temporarily fix this by updating your build.gradle file with a forked plugin.

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        //required to get the plugin working again with gradle:0.11+ and AS0.6.0
        maven { url 'https://github.com/rockerhieu/mvn-repo/raw/master/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.11.+'
        //classpath 'org.robolectric.gradle:gradle-android-test-plugin:0.10.+'
        //required to get the plugin working again on AS 0.6.0
        classpath 'org.robolectric.gradle:gradle-android-test-plugin:0.10.1-SNAPSHOT'
    }
}
...

See https://github.com/robolectric/robolectric-gradle-plugin/issues/31 for more information on the issue status.


I haven't updated the code on Github, because I hope that the plugin will be fixed quite soon.

Update

A fix has been released, read more in this post: http://raptordigital.blogspot.be/2014/06/robolectric-plugin-upgraded-to-011x.html.


Geen opmerkingen:

Een reactie posten