我需要使用Facebook Login,Share和其他一些facebook的东西,所以我包括com.facebook.android:facebook-android-sdk:4.40.0。我的应用程序中需要Facebook Ads,因此包含com.facebook.android:audience-network-sdk:5.1.1。但是在编译代码时,我得到了Dex Builder异常。
com.android.builder.dexing.DexArchiveBuilderException:com.android.builder.dexing.DexArchiveBuilderException:无法处理C:\ Users \ Volobot \ StudioProjects \ Some-App-original \ SomeApp \ libs \ facebook-4.27.0 。罐
在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)处
在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
在java.lang.reflect.Constructor.newInstance(Constructor.java:423)
在java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
在java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
在java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
在com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:146)
在com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:405)
在com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:239)
在com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:235)
在com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
在com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
在sun.reflect.GeneratedMethodAccessor106.invoke(未知来源)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:498)
在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
在org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 1.run(ExecuteActionsTaskExecuter.java:131)
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)处
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)处
在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
在org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
在org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)处
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
在org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)处
在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
在org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)处
在org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
在org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
在org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)处
在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.run(EventFiringTaskExecuter.java:51)
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)处
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)处
在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
在org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
在org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)处
在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)处
在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:136)处
在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:130)处
在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)处
在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)处
在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)上
在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
在org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:46)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)
在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
在java.lang.Thread.run(Thread.java:745)
引起原因:com.android.builder.dexing.DexArchiveBuilderException:无法处理C:\ Users \ Volobot \ StudioProjects \ Some-App-original \ SomeApp \ libs \ facebook-4.27.0.jar
在com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:900)
在com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.lambda $ convertToDexArchive $ 6(DexArchiveBuilderTransform.java:825)
在java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec(ForkJoinTask.java:1424)
在java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
在java.util.concurrent.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:1056)
在java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
在java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
引起原因:com.android.builder.dexing.DexArchiveBuilderException:解密时出错。
在com.android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.java:124)
在com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:101)
在com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:895)
...另外6个
引起原因:com.android.tools.r8.CompilationFailedException:编译无法完成
在com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:65)
在com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:43)
在com.android.tools.r8.D8.run(D8.java:90)
在com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:99)
...另外7个
引起原因:com.android.tools.r8.utils.AbortException:错误:类型com.facebook.ads.internal.view.d被引用为com.facebook.ads.internal.view.y
的接口。
在com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:116)
在com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:74)
在com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:59)
...还有10个
答案 0 :(得分:0)
Facebook SDK和Facebook Audience Network SDK是独立的,因此您应该能够分别包含它们的任何版本。 看起来您还包括facebook-4.27.0.jar,请检查您只有1个版本的AN SDK。