Closed OleksandrKucherenko closed 6 years ago
gradle-4.1-bin
gradle version in use
Just double checked it with
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
and it it works fine for me.
From the exception it says it had trouble opening the downloaded android-all-file
Do you use the "downloadFrom" way to configure the android-all url or do you use the "unmock" dependency?
If you don't configure anything it will default to "downloadFrom" which is known to give problems like this sometimes. It seems that the downloaded file is corrupted and we cannot open it.
If you use the dependency then clearing the Gradle caches should help. If you are using "downloadFrom" (or just use the default) it would be best to change to the dependency way.
project and sub-module both reference/depends on unMock plugin... maybe issues is in this area
I'll try that setup, too (works with older versions of Gradle at least)
which Android Gradle plugin is in use? did this happen suddenly after upgrading the Gradle version?
GRADLE_PLUGIN=2.3.3 GOOGLE_PLAY_PLUGIN=3.1.1 UNMOCK_PLUGIN=0.6.4
Workaround:
step 1: disable unMock task for all sub-projects/modules:
Place it in root build.gradle:
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("de.mobilej.unmock.UnMockPlugin".equals(plugin.class.name)) {
if(!"app".equals(project.name)) {
project.tasks["unMock"].onlyIf{ false }
}
}
}
}
in project dependencies:
step 2: upgrade version of unmock classes
dependencies {
/* https://oss.sonatype.org/content/groups/public/org/robolectric/android-all/ */
unmock 'org.robolectric:android-all:8.0.0_r4-robolectric-r1'
}
Nice you found a way to make it work for you. Unfortunately I'm still unable to reproduce the behavior. Maybe you can share some minimal code to reproduce this?
try to create a project with lib module. in both dirs app
and module
configure usage of the unMock plugin....
try full rebuild of the project. than it quite often fails...
I tried that with a minimal project w/o any actual code but it works for me all the time
I attached the project unmocktest.zip
I will try to find time for making a simplified version of project and will upload it here.
Since there is no activity for a long time - closing it - if it is still a problem and there is a way to reproduce it please reopen