Kotlin和Android数据绑定(BuildTools 2.0.0)

Kotlin和Android数据绑定(BuildTools 2.0.0),第1张

概述在我的Android项目中,我正在使用Kotlin和Android数据绑定.它工作得很好,但现在我想将androidgradle插件更新为2.0.0-beta5版本.构建项目时,出现以下错误:例外在这里java.lang.RuntimeException:failure,seelogsfordetails.cannotgenerateviewbindersjava.lang.NoSuchM

在我的Android项目中,我正在使用Kotlin和AndroID数据绑定.它工作得很好,但现在我想将androID gradle插件更新为2.0.0-beta5版本.构建项目时,出现以下错误:

例外在这里

java.lang.RuntimeException: failure, see logs for details.cannot generate vIEw binders java.lang.NoSuchMethodError: kotlin.text.StringsKt.split$default(Ljava/lang/CharSequence;[Ljava/lang/String;ZII)Ljava/util/List;    at androID.databinding.tool.ext.ExtKt.androIDID(ext.kt:76)    at androID.databinding.tool.writer.LayoutBinderWriterKt$readablename.invoke(LayoutBinderWriter.kt:99)    at androID.databinding.tool.writer.LayoutBinderWriterKt$readablename.invoke(LayoutBinderWriter.kt)    at androID.databinding.tool.ext.LazyExt.getValue(ext.kt:27)    at androID.databinding.tool.writer.LayoutBinderWriterKt.getReadablename(LayoutBinderWriter.kt)    at androID.databinding.tool.LayoutBinder.<init>(LayoutBinder.java:202)    at androID.databinding.tool.DataBinder.<init>(DataBinder.java:49)    at androID.databinding.tool.CompilerChef.ensureDataBinder(CompilerChef.java:81)    at androID.databinding.tool.CompilerChef.sealModels(CompilerChef.java:130)    at androID.databinding.annotationprocessor.ProcessExpressions.writeResourceBundle(ProcessExpressions.java:149)    at androID.databinding.annotationprocessor.ProcessExpressions.onHandleStep(ProcessExpressions.java:82)    at androID.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.runStep(ProcessDataBinding.java:154)    at androID.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.access0(ProcessDataBinding.java:139)    at androID.databinding.annotationprocessor.ProcessDataBinding.process(ProcessDataBinding.java:66)    at org.jetbrains.kotlin.annotation.AnnotationProcessorWrapper.process(AnnotationProcessorWrapper.kt:136)    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access00(JavacProcessingEnvironment.java:97)    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)    at com.sun.tools.javac.main.Main.compile(Main.java:439)    at com.sun.tools.javac.API.JavacTaskImpl.call(JavacTaskImpl.java:132)    at org.gradle.API.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:45)    at org.gradle.API.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)    at org.gradle.API.internal.tasks.compile.normalizingJavaCompiler.delegateAndHandleErrors(normalizingJavaCompiler.java:101)    at org.gradle.API.internal.tasks.compile.normalizingJavaCompiler.execute(normalizingJavaCompiler.java:50)    at org.gradle.API.internal.tasks.compile.normalizingJavaCompiler.execute(normalizingJavaCompiler.java:36)    at org.gradle.API.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)    at org.gradle.API.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)    at org.gradle.API.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:157)    at org.gradle.API.tasks.compile.JavaCompile.compile(JavaCompile.java:139)    at org.gradle.API.tasks.compile.JavaCompile.compile(JavaCompile.java:93)    at com.androID.build.gradle.tasks.factory.AndroIDJavaCompile.compile(AndroIDJavaCompile.java:39)    at sun.reflect.GeneratedMethodAccessor2323.invoke(UnkNown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:606)    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)    at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)    at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)    at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)    at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)    at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)    at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)    at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)    at org.gradle.API.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)    at org.gradle.API.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)    at org.gradle.API.internal.tasks.execution.ValIDatingTaskExecuter.execute(ValIDatingTaskExecuter.java:58)    at org.gradle.API.internal.tasks.execution.SkipEmptySourcefilesTaskExecuter.execute(SkipEmptySourcefilesTaskExecuter.java:52)    at org.gradle.API.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)    at org.gradle.API.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)    at org.gradle.API.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processtask(AbstractTaskPlanExecutor.java:66)    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)    at org.gradle.execution.DefaultBuildExecuter.access0(DefaultBuildExecuter.java:23)    at org.gradle.execution.DefaultBuildExecuter.proceed(DefaultBuildExecuter.java:43)    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:154)    at org.gradle.internal.FactorIEs.create(FactorIEs.java:22)    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)    at org.gradle.initialization.DefaultGradleLauncher.dobuildStages(DefaultGradleLauncher.java:151)    at org.gradle.initialization.DefaultGradleLauncher.access0(DefaultGradleLauncher.java:32)    at org.gradle.initialization.DefaultGradleLauncher.create(DefaultGradleLauncher.java:99)    at org.gradle.initialization.DefaultGradleLauncher.create(DefaultGradleLauncher.java:93)    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)    at org.gradle.initialization.DefaultGradleLauncher.dobuild(DefaultGradleLauncher.java:93)    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)    at org.gradle.tooling.internal.provIDer.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)    at org.gradle.tooling.internal.provIDer.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.dobuild(ExecuteBuild.java:52)    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.exec.WatchFordisconnection.execute(WatchFordisconnection.java:37)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.exec.resetDeprecationLogger.execute(resetDeprecationLogger.java:26)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.call(ForwardClIEntinput.java:74)    at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.call(ForwardClIEntinput.java:72)    at org.gradle.util.Swapper.swap(Swapper.java:38)    at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.execute(ForwardClIEntinput.java:72)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.exec.LogToClIEnt.dobuild(LogToClIEnt.java:66)    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.dobuild(EstablishBuildEnvironment.java:72)    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)    at org.gradle.launcher.daemon.server.API.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)    at org.gradle.launcher.daemon.server.exec.StartBuildOrResponDWithBusy.run(StartBuildOrResponDWithBusy.java:50)    at org.gradle.launcher.daemon.server.DaemonStateCoordinator.run(DaemonStateCoordinator.java:246)    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)    at org.gradle.internal.concurrent.StoppableExecutorImpl.run(StoppableExecutorImpl.java:40)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)    at java.lang.Thread.run(Thread.java:745)

有没有人已经遇到过这个问题,有没有办法解决?

解决方法:

在使用beta 5版本时,这确实发生在我身上:

classpath’com.androID.tools.build:gradle:2.0.0-beta5′

您可以立即升级到最新版本(今天为beta 6),它将为您解决问题:

classpath’com.androID.tools.build:gradle:2.0.0-beta6′

总结

以上是内存溢出为你收集整理的Kotlin和Android数据绑定(BuildTools 2.0.0)全部内容,希望文章能够帮你解决Kotlin和Android数据绑定(BuildTools 2.0.0)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1120613.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存