在我的Unity3d项目中添加Firebase功能后出现此错误。
有同样问题的人吗?
我们尝试过“颤振医生--android许可证”,就像https://github.com/flutter/flutter/issues/30573中建议的那样。
到目前为止什么都不起作用。
下面是整个错误消息。
================================================
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2020.3.19f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2020.3.19f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':launcher:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':launcher:debugRuntimeClasspath'.
> Cannot set the value of read-only property 'class' for object of type org.gradle.api.internal.artifacts.DefaultExcludeRule.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[
> Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <c8b3b39837d14a59b516963b78bf9032>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c8b3b39837d14a59b516963b78bf9032>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <c8b3b39837d14a59b516963b78bf9032>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <97ba64834c8f4edc84e3d8e30b04f122>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
发布于 2022-01-08 00:54:57
我遇到了一个类似的问题,原因是使用gradle版本32.0.0。
请检查此链接的单位问题跟踪器:
因此,我通过卸载build 32.0.0并使用30.0.2 (来自sdk管理器)来解决这个问题。
Android构建工具:https://i.stack.imgur.com/mo6SB.png
https://stackoverflow.com/questions/70148245
复制相似问题