曾经做过JavaFX项目。本来打算移植到android,但遇到了问题。我在整个项目中一直在使用Reactor的Flux Mono。我的网络一直在使用Spring WebFlux的ReactorNettyWebSocketClient。
当我尝试制作APK时,applyRetrolamba任务一直失败。我知道这与可选依赖项有关(因为我得到的ClassNotFoundExceptions来自我不使用的依赖项),但我不完全理解为什么。在此阶段,它似乎需要所有可选的依赖项。
我真的不知道该怎么做。
这是我的错误:
00:01 ERROR: Failed to run Retrolambda
java.lang.RuntimeException: Failed to backport class: org/springframework/web/method/annotation/ModelAttributeMethodProcessor
at net.orfjackal.retrolambda.Transformers.transform(Transformers.java:129)
at net.orfjackal.retrolambda.Transformers.transform(Transformers.java:107)
at net.orfjackal.retrolambda.Transformers.backportClass(Transformers.java:47)
at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:92)
at net.orfjackal.retrolambda.Main.main(Main.java:28)
Caused by: java.lang.RuntimeException: Failed to backport lambda or method reference: org/springframework/web/method/annotation/ModelAttributeMethodProcessor.lambda$constructAttribute$0(Ljava/lang/reflect/Constructor;)Ljava/lang/String; (6)
at net.orfjackal.retrolambda.lambdas.LambdaReifier.reifyLambdaClass(LambdaReifier.java:44)
at net.orfjackal.retrolambda.lambdas.BackportLambdaInvocations$InvokeDynamicInsnConverter.backportLambda(BackportLambdaInvocations.java:194)
at net.orfjackal.retrolambda.lambdas.BackportLambdaInvocations$InvokeDynamicInsnConverter.visitInvokeDynamicInsn(BackportLambdaInvocations.java:183)
at net.orfjackal.retrolambda.asm.ClassReader.readCode(ClassReader.java:1519)
at net.orfjackal.retrolambda.asm.ClassReader.readMethod(ClassReader.java:1032)
at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:708)
at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:521)
at net.orfjackal.retrolambda.Transformers.lambda$transform$4(Transformers.java:107)
at net.orfjackal.retrolambda.Transformers.transform(Transformers.java:125)
... 4 more
Caused by: java.lang.IllegalAccessException: no such method: org.springframework.web.method.annotation.ModelAttributeMethodProcessor.lambda$constructAttribute$0(Constructor)String/invokeStatic
at java.lang.invoke.MemberName.makeAccessException(MemberName.java:867)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1003)
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1386)
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:780)
at net.orfjackal.retrolambda.lambdas.Types.toMethodHandle(Types.java:46)
at net.orfjackal.retrolambda.lambdas.Types.asmToJdkType(Types.java:26)
at net.orfjackal.retrolambda.lambdas.LambdaReifier.callBootstrapMethod(LambdaReifier.java:117)
at net.orfjackal.retrolambda.lambdas.LambdaReifier.reifyLambdaClass(LambdaReifier.java:39)
... 12 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/validation/BindException
at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
... 18 more
Caused by: java.lang.ClassNotFoundException: org.springframework.validation.BindException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at net.orfjackal.retrolambda.NonDelegatingClassLoader.loadClass(NonDelegatingClassLoader.java:27)
... 21 more
:client:applyRetrolambda FAILED