gpt4 book ai didi

android - 试图从类 com.android.utils.FileUtils 访问方法 com.google.common.io.Files.fileTreeTraverser()

转载 作者:行者123 更新时间:2023-12-04 22:39:24 24 4
gpt4 key购买 nike

在 androidx 中合并支持库后出现以下错误。

Caused by: java.lang.IllegalAccessError: tried to access method com.google.common.io.Files.fileTreeTraverser()Lcom/google/common/collect/TreeTraverser; from class com.android.utils.FileUtils
at com.android.utils.FileUtils.getAllFiles(FileUtils.java:394)
at com.android.build.gradle.internal.transforms.StripDebugSymbolTransform.transform(StripDebugSymbolTransform.java:188)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
... 31 more

androidx合并后出现此问题。看起来问题似乎在于从类 FileUtils 访问方法 Files.fileTreeTraverser()。

任何想法为什么它会出现以及如何解决它,拜托?

最佳答案

我通过更新解决了问题

  • gradle 构建工具版本
    classpath 'com.android.tools.build:gradle:3.4.2'
  • gradle 包装器属性文件
    distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
  • Kotlin 版本到 1.3.10 或更高版本
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.10"
  • 关于android - 试图从类 com.android.utils.FileUtils 访问方法 com.google.common.io.Files.fileTreeTraverser(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57232305/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com