cucumber / cucumber-android

Android support for Cucumber-JVM
MIT License
135 stars 62 forks source link

Execution failed for task ':cucumber-android:mergeDebugJavaResource'. #106

Closed gt4dev closed 2 years ago

gt4dev commented 2 years ago

Hi

On a freshly checked out project, when I call: ./gradlew assemble

gradle is working for a while and ends with an error:

// cut of some init logs ...

Welcome to Gradle 7.2!

Here are the highlights of this release:
 - Toolchain support for Scala
 - More cache hits when Java source files have platform-specific line endings
 - More resilient remote HTTP build cache behavior

For more details see https://docs.gradle.org/7.2/release-notes.html

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
Warning: This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.

> Task :cucumber-android:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :cucumber-android:mergeDebugJavaResource FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cucumber-android:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 'java.lang.String com.android.utils.FileUtils.relativePossiblyNonExistingPath(java.io.File, java.io.File)'

Do you know what can be wrong? How to fix it? ;]

I'm working now on macOs + AndroidStudio. But identical error I found on Windows + AndroidStudio, even I described it on slack https://cucumberbdd.slack.com/archives/CBKTMP21M/p1661115256726439

Thanks & cheers GT

gt4dev commented 2 years ago

I updated versions in build AGP to 7.3 'com.android.tools.build:gradle:7.3.1' and gradle to 7.4 distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip

and build went further but now - it fails on below problem possibly KAPT requires update or sth near ...

> Task :cukeulator:kaptGenerateStubsReleaseKotlin FAILED
e: java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x7c26222b) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x7c26222b
        at org.jetbrains.kotlin.kapt3.base.KaptContext.<init>(KaptContext.kt:28)
        at org.jetbrains.kotlin.kapt3.KaptContextForStubGeneration.<init>(KaptContextForStubGeneration.kt:40)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.contextForStubGeneration(Kapt3Extension.kt:287)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:171)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:102)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$invokeExtensionsOnAnalysisComplete(TopDownAnalyzerFacadeForJVM.kt:112)
lsuski commented 2 years ago

I've updated build tools on main branch https://github.com/cucumber/cucumber-android/pull/107

gt4dev commented 2 years ago

now build works - big thanks! small problem: I had to start ./gradlew assemble 2-3 times before it finished with success

finally tests are starting


pozdrowienia z GDA