gpt4 book ai didi

android - Unity Gradle构建失败

转载 作者:行者123 更新时间:2023-12-03 06:33:07 26 4
gpt4 key购买 nike

我正在使用Unity 2019.3.3f1 Personal,当我尝试构建64位时,出现212错误。
我认为那是最重要的一个,所以我只粘贴了这些:

CommandInvokationFailure:Gradle构建失败。
C:/ Program Files / Unity / Hub / Editor / 2019.3.3f1 / Editor / Data / PlaybackEngines / AndroidPlayer \ OpenJDK \ bin \ java.exe -classpath“C:\ Program Files \ Unity \ Hub \ Editor \ 2019.3.3f1 \ Editor \ Data \ PlaybackEngines \ AndroidPlayer \ Tools \ gradle \ lib \ gradle-launcher-5.1.1.jar“org.gradle.launcher.GradleMain” -Dorg.gradle.jvmargs = -Xmx4096m“” assembleDebug“

stderr [
D8:程序类型已经存在:com.unity3d.player.BuildConfig
java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex归档时出错:
程序类型已经存在:com.unity3d.player.BuildConfig
https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。
在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.google.common.collect.ImmutableList.forEach(ImmutableList.java:407)
在com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:244)
在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.NativeMethodAccessorImpl.invoke0(本机方法)处
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
在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.IncrementalTask​​Action.doExecute(IncrementalTask​​Action.java:47)
在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 2.run(ExecuteActionsTaskExecuter.java:284)
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)处
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)上
在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
在org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
在org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access $ 200(ExecuteActionsTaskExecuter.java:67)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ TaskExecution.execute(ExecuteActionsTaskExecuter.java:145)处
在org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49)
在org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)处
在org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
在org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
在org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33)
在org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
在org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43)
在org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29)
在org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134)
在org.gradle.internal.execution.impl.steps.CacheStep.lambda $ execute $ 3(CacheStep.java:83)
在java.util.Optional.orElseGet(Optional.java:267)
在org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)
在org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36)
在org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
在org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
在org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
在org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
在org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda $ execute $ 0(SkipUpToDateStep.java:89)
在java.util.Optional.map(Optional.java:215)
在org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
在org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
在org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91)
在org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)处
在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119)
在org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43)
在org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)
在org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)
在org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94)处
在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56)
在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55)
在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.executeTask(EventFiringTaskExecuter.java:67)
在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.call(EventFiringTaskExecuter.java:52)
在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.call(EventFiringTaskExecuter.java:49)
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)处
在org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)处
在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
在org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)处
在org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
在org.gradle.execution.plan.LocalTask​​NodeExecutor.execute(LocalTask​​NodeExecutor.java:43)
在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)处
在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)处
在org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)处
在org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker $ 1.execute(DefaultPlanExecutor.java:134)
在org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker $ 1.execute(DefaultPlanExecutor.java:129)
在org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.execute(DefaultPlanExecutor.java:202)处
在org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
在org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.run(DefaultPlanExecutor.java:129)
在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:1149)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)
在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
在java.lang.Thread.run(Thread.java:748)
引起原因:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错:
程序类型已经存在:com.unity3d.player.BuildConfig
https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。
在java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec(ForkJoinTask.java:1431)
在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.DexArchiveMergerException:合并dex存档时出错:
程序类型已经存在:com.unity3d.player.BuildConfig
https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。
在com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131)
在com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118)
在com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
在com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:37)
在java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec(ForkJoinTask.java:1424)
...另外4个
引起原因:com.android.tools.r8.CompilationFailedException:编译无法完成
在com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:81)
在com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)
在com.android.tools.r8.D8.run(D8.java:94)
在com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:116)
...另外7个
引起原因:com.android.tools.r8.utils.AbortException:错误:程序类型已存在:com.unity3d.player.BuildConfig
在com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:101)
在com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:72)
在com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:66)
...另外10个

失败:生成失败,发生异常。

  • 出了什么问题:
    任务':launcher:transformDexArchiveWithDexMergerForDebug'的执行失败。

    com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Program type already present: com.unity3d.player.BuildConfig Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

  • 尝试:
    使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行,以获取更多日志输出。与--scan一起运行以获取完整的见解。
  • https://help.gradle.org上获得更多帮助

  • 15秒内失败
    ]
    标准输出[

    Configure project :launcher Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

    Task :unityLibrary:preBuild UP-TO-DATE Task :launcher:preBuild UP-TO-DATE Task :unityLibrary:preDebugBuild UP-TO-DATE Task :launcher:prepareLintJar UP-TO-DATE Task :unityLibrary:checkDebugManifest UP-TO-DATE Task :unityLibrary:processDebugManifest Task :unityLibrary:compileDebugAidl NO-SOURCE Task :unityLibrary:packageDebugRenderscript NO-SOURCE Task :unityLibrary:compileDebugRenderscript NO-SOURCE Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE Task :unityLibrary:generateDebugResValues UP-TO-DATE Task :unityLibrary:generateDebugResources UP-TO-DATE Task :launcher:preDebugBuild Task :launcher:compileDebugAidl NO-SOURCE Task :launcher:compileDebugRenderscript NO-SOURCE Task :launcher:checkDebugManifest UP-TO-DATE Task :launcher:generateDebugBuildConfig UP-TO-DATE Task :launcher:generateDebugSources UP-TO-DATE Task :unityLibrary:packageDebugResources UP-TO-DATE Task :launcher:mainApkListPersistenceDebug UP-TO-DATE Task :launcher:generateDebugResValues UP-TO-DATE Task :launcher:generateDebugResources UP-TO-DATE Task :unityLibrary:generateDebugRFile UP-TO-DATE Task :unityLibrary:prepareLintJar UP-TO-DATE Task :unityLibrary:generateDebugSources UP-TO-DATE Task :unityLibrary:javaPreCompileDebug UP-TO-DATE Task :launcher:mergeDebugResources UP-TO-DATE Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE Task :unityLibrary:compileDebugJavaWithJavac UP-TO-DATE Task :unityLibrary:bundleLibCompileDebug UP-TO-DATE Task :unityLibrary:mergeDebugShaders UP-TO-DATE Task :unityLibrary:compileDebugShaders UP-TO-DATE Task :unityLibrary:generateDebugAssets UP-TO-DATE Task :launcher:processDebugManifest Task :launcher:javaPreCompileDebug UP-TO-DATE Task :unityLibrary:packageDebugAssets Task :unityLibrary:bundleLibRuntimeDebug UP-TO-DATE Task :unityLibrary:processDebugJavaRes NO-SOURCE Task :unityLibrary:bundleLibResDebug UP-TO-DATE Task :unityLibrary:mer



    当即时通讯建立32位时,我可以完美地建立。
    我在一周内处理该错误,因此请帮助:(

    最佳答案

    我只是通过降级到2018.4.14f并选择内部版本来解决。

    关于android - Unity Gradle构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61044658/

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