reportportal / agent-java-junit

Report Portal agent for JUnit 4
Apache License 2.0
11 stars 17 forks source link

Cannot include report portal in android repo because of `com.epam.reportportal:httpclient-repacked:1.0.2` #18

Closed prolificcoder closed 3 years ago

prolificcoder commented 5 years ago

I tried to include this project in an android repo with testImplementation ('com.epam.reportportal:agent-java-junit:2.7.2') And I am getting this error image

Things I tried so far

  1. Added a repository: maven { url 'http://dl.bintray.com/epam/reportportal' }
  2. Changed repository to jcenter { url 'http://dl.bintray.com/epam/reportportal' }
  3. Also tried to exclude the repacked module by
    testImplementation ('com.epam.reportportal:agent-java-junit:2.7.2') {
    exclude group: 'com.epam.reportportal', module: 'httpclient-repacked'
    }

    But this gives a compile error

prolificcoder commented 5 years ago

I forked a kotlin project and made the changes to include

  1. https://github.com/prolificcoder/android-sunflower/blob/report_portal/build.gradle#L68
  2. https://github.com/prolificcoder/android-sunflower/blob/report_portal/app/build.gradle#L75

If I just have 2) I get the same error as above. After I added 1) I get this error that I can't really make sense of

./gradlew connectedAndroidTest
e: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: android.databinding.annotationprocessor.ProcessDataBinding Unable to get public no-arg constructor
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:581)
        at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:672)
        at java.base/java.util.ServiceLoader.access$1000(ServiceLoader.java:390)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1227)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1259)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1294)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1379)
        at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1132)
        at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1165)
        at kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1156)
        at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors(ProcessorLoader.kt:36)
        at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors$default(ProcessorLoader.kt:24)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.loadProcessors(Kapt3Extension.kt:90)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:167)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:100)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:95)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:105)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:82)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:375)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:67)
        at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:366)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:120)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:161)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:57)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:96)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:52)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:93)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:442)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:102)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:1029)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
        at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:1071)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:1028)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:441)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:800)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:682)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
        at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3110)
        at java.base/java.lang.Class.getConstructor0(Class.java:3315)
        at java.base/java.lang.Class.getConstructor(Class.java:2108)
        at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:659)
        at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:656)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:667)
        ... 51 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
        ... 59 more

> Task :app:kaptDebugKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> Internal compiler error. See log for more details
sbabcoc commented 5 years ago

This agent has been completely reimplemented, and in the process the old back-end communication library was replaced with the same library used by the TestNG agent. The problematic JAR is no longer a transitive dependency, which should resolve this issue.

DzmitryHumianiuk commented 5 years ago

@akoltochihin ^

filland commented 5 years ago

@prolificcoder could you please tell if this issue solved ?

dhirajhike commented 4 years ago

@avarabyeu , can you please add ReadMe for Integration of Report Portal with Android Gradle. It is being very tedious to do it.

HardNorth commented 3 years ago

Relates to: https://github.com/reportportal/client-java/issues/129 Will try to fix it after JBehave and Spock agents implementation.

HardNorth commented 3 years ago

OK, we've got a solution for Android: https://github.com/reportportal/agent-android Unfortunately it's for JUnit 5. And there is no plans for JUnit 4, since it requires enormous amount of implementation. The best I can suggest here is to try run your JUnit 4 tests with JUnit 5. Apart from that, the issue is closed.