2017-12-05 30 views
0

로 업그레이드하는 동안 : Gradle을 버전 이상 사용하는 경우ClassCastException이 Gradle을 4.1 나는 다음과 같은 Gradle을 배포판을 사용

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip 

는, 그것은 나에게로 ClassCastException를주는 것은 내가 명령 아래에 실행할 때.

./gradlew dependencyUpdates --stacktrace 

    * What went wrong: 
    Execution failed for task ':app:dependencyUpdates'. 
    > java.lang.String cannot be cast to org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.Version 

    * Try: 
    Run with --info or --debug option to get more log output. 

    * Exception is: 
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:dependencyUpdates'. 
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) 
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) 
      at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63) 
      at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) 
      at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 
      at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) 
      at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.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:54) 
      at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) 
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107) 
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241) 
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230) 
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124) 
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80) 
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105) 
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99) 
      at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625) 
      at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580) 
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99) 
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) 
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) 
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) 
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to 
org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.Version 
      at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.StaticVersionComparator.compare(StaticVersionComparator.java:25) 
      at java_util_Comparator$compare.call(Unknown Source) 
      at com.github.benmanes.gradle.versions.updates.VersionComparator.compare(VersionComparator.groovy:49) 
      at com.github.benmanes.gradle.versions.updates.VersionComparator$compare.call(Unknown Source) 
      at com.github.benmanes.gradle.versions.updates.Resolver.<init>(Resolver.groovy:53) 
      at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_run_closure2.doCall(DependencyUpdates.groovy:57) 
      at com.github.benmanes.gradle.versions.updates.DependencyUpdates.run(DependencyUpdates.groovy:56) 
      at com.github.benmanes.gradle.versions.updates.DependencyUpdates$run.call(Unknown Source) 
      at com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask.dependencyUpdates(DependencyUpdatesTask.groovy:54) 
      at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) 
      at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141) 
      at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134) 
      at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121) 
      at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:731) 
      at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:705) 
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197) 
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107) 
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111) 
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92) 
      ... 27 more 


    * Get more help at https://help.gradle.org 
+0

왜 빈 버전을 사용 하시겠습니까의 최신 버전으로 업그레이드? gradle-4.1-all.zip을 사용해보십시오 –

+0

gradle-4.1-all.zip도 동일 오류 – user9187

답변

1

gradle-versions-plugin

+1

com.github.ben-manes : gradle-versions-plugin : 0.17.0에서 작업했습니다. – user9187