命令调用失败:Gradle构建失败,(尚无解决方案)

lf5gs5x2  于 2023-01-17  发布在  其他
关注(0)|答案(4)|浏览(131)

2天前它工作正常,现在它这样做,谢谢您的回答

命令调用失败:Gradle构建失败。C:/程序文件/统一/集线器/编辑器/2019.2.21f1/编辑器/数据/回放引擎/安卓播放器/工具\OpenJDK\Windows\bin\java.exe-类路径"C:\程序文件\统一\集线器\编辑器\2019.2.21f1\编辑器\数据\回放引擎\安卓播放器\工具\gradle\lib\gradle-启动器-5.1.1.jar" org. gradle.启动器. GradleMain "-文档. gradle. jvmargs =-Xmx4096m""捆绑包发布"
标准错误[
失败:生成失败,出现异常。

  • 出了什么问题:配置根项目"gradleOut"时出现问题。

未能安装以下Android SDK包,因为某些许可证尚未被接受。platforms;android-29 Android SDK Platform 29要构建此项目,请接受SDK许可协议并使用Android Studio SDK管理器安装缺少的组件。或者,要将许可协议从一个工作站传输到另一个工作站,请参阅http://d.android.com/r/studio-ui/export-licenses.html
使用Android SDK:C:\程序文件\统一\集线器\编辑器\2019.2.21f1\编辑器\数据\回放引擎\AndroidPlayer\SDK

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

构建在2s内失败]标准输出[
配置项目:警告:选项设置"android. bundle. enableUncompressedNativeLibs = false"是实验性的,不受支持。当前默认值为"true"。

Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.21f1\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.2.21f1\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.2.21f1\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.2.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.21f1\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.2.21f1\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.2.21f1\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.2.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.2.21f1\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.2.21f1\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.2.21f1\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.2.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only File C:\Users\Ziga.android\repositories.cfg could not be loaded. Checking the license for package Android SDK Platform 29 in C:\Program Files\Unity\Hub\Editor\2019.2.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\licenses Warning: License for package Android SDK Platform 29 not accepted. ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action 1[T] progress, System.String error) (at <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action 1[T] progress) (at <502f1b7df2d7430696af84c6f02852ed>: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 <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>: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 <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>: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 <502f1b7df2d7430696af84c6f02852ed>:0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <502f1b7df2d7430696af84c6f02852ed>: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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

qyyhg6bp

qyyhg6bp1#

在构建时,请确保您连接到良好的互联网连接。这可能是你已经更改为尚未安装的目标API版本。Unity可以下载该版本,而构建apk,如果连接到互联网(它为我安装的).如果在构建apk时打开任何sdk安装窗口并提示接受任何许可协议,也要确保你的防火墙没有阻止Unity(openjdk和unityhub可能也需要访问)。

9njqaruj

9njqaruj2#

就我而言
我连接了移动的数据4G,我构建了Unity项目,我有相同的错误Gradle失败了,我连接了Wi-Fi,没有发现错误,构建成功。

de90aj5v

de90aj5v3#

如果捆绑包版本0更改为1

xpcnnkqh

xpcnnkqh4#

对我来说,当我修复了另一个由重复库类引起的错误时,这个问题就消失了。我进入Assets/Plugins/Android,点击了罪魁祸首(在我的例子中,它是“com.unity3d.ads.unity-ads-4.5.0”插件,然后取消选中Android作为插件的选定平台。之后,我就可以构建了。

相关问题