gpt4 book ai didi

Android:v7 支持 lib 27.1.0 "Program type already present"android.support.v7.recyclerview.extensions.ListAdapter 的编译错误

转载 作者:行者123 更新时间:2023-12-04 01:27:31 26 4
gpt4 key购买 nike

我认为 27.1.0 v7 支持库肯定存在错误,just released .更新我的项目以使用它(从 26.1.0 开始)后,我不断收到此编译错误:

Task :app:transformDexArchiveWithDexMergerForRegularDebug FAILED D8 is used to merge dex. Program type already present: android.support.v7.recyclerview.extensions.ListAdapter

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:transformDexArchiveWithDexMergerForRegularDebug'. com.android.build.api.transform.TransformException: com.android.tools.r8.errors.CompilationError: Program type already present: android.support.v7.recyclerview.extensions.ListAdapter

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

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithDexMergerForRegularDebug'. 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.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87) 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:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) 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:123) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98) 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.RuntimeException: com.android.build.api.transform.TransformException: com.android.tools.r8.errors.CompilationError: Program type already present: android.support.v7.recyclerview.extensions.ListAdapter at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46) 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:121) 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:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92) ... 29 more Caused by: com.android.build.api.transform.TransformException: com.android.tools.r8.errors.CompilationError: Program type already present: android.support.v7.recyclerview.extensions.ListAdapter at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:230) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102) ... 41 more Caused by: com.android.tools.r8.errors.CompilationError: Program type already present: android.support.v7.recyclerview.extensions.ListAdapter at com.android.tools.r8.utils.ProgramClassCollection.resolveClassConflictImpl(ProgramClassCollection.java:61) at com.android.tools.r8.utils.ProgramClassCollection.lambda$create$0(ProgramClassCollection.java:22) at com.android.tools.r8.utils.ProgramClassCollection.create(ProgramClassCollection.java:22) at com.android.tools.r8.graph.DexApplication$Builder.build(DexApplication.java:408) at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:96) at com.android.tools.r8.D8.runForTesting(D8.java:179) at com.android.tools.r8.D8.runForTesting(D8.java:152) at com.android.tools.r8.D8.run(D8.java:71) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:73) at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:97) at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:35)



我查看了我的项目的依赖项( ./gradlew :<module>:dependencies [其中 <module> 是我的所有模块])并验证我只有一个依赖项应该支持 ListAdapter类,就是这个:
implementation "com.android.support:recyclerview-v7:27.1.0"

我也用
configurations.all {
resolutionStrategy {
...
force "com.android.support:recyclerview-v7:27.1.0"
}
}

我尝试过清洁/重建。我尝试过使缓存无效并重新启动。我也尝试手动删除我所有的构建文件夹和 .gradle文件夹。我也尝试过禁用 D8,但是我的构建永远挂起。问题仍然存在。我什至没有使用 ListAdapter !

最佳答案

弄清楚了!结果是 android.arch.paging:runtime-1.0.0-alpha4-1 依赖也有ListAdapter宣布。将分页库更新为 后阿尔法6 ,问题解决了。

编辑 由于某种原因,这个问题引起了很多关注!所以,我想我会把这条评论添加为“教一个人钓鱼”之类的时刻。问题:我怎么知道我的 ListAdapter 在哪里?是从哪里来的?答案?如果您使用的是 Android Studio/IntelliJ IDEA,请按 ctrl+n 开始搜索类名。你会看到这个对话框:

enter image description here

请注意复选框!如果您没有检查,您将永远找不到库中包含的类。选中后,它将显示项目中每个类的出处。

关于Android:v7 支持 lib 27.1.0 "Program type already present"android.support.v7.recyclerview.extensions.ListAdapter 的编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49038630/

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