简体   繁体   English

我无法在 Unity3D 中构建 android 应用程序。 错误 Gradle 初始化失败

[英]I am not able to build android app in Unity3D. Error Gradle initialization failed

I am using an empty Unity Android project.我正在使用一个空的 Unity Android 项目。 I am not able to build APK since 2 weeks.自 2 周以来,我无法构建 APK。 I am getting this error我收到此错误

CommandWithNoStdoutInvokationFailure: Gradle initialization failed. CommandWithNoStdoutInvokationFailure:Gradle 初始化失败。 UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <4132c5c2cd7b45b09ef33302ae416489>:0) UnityEditor.Android.AndroidJavaTools.RunJavaWithShellExecute (System.String args, System.String workingdir, System.String error) (at <4132c5c2cd7b45b09ef33302ae416489>:0) UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <4132c5c2cd7b45b09ef33302ae416489>:0) UnityEditor.Android.AndroidJavaTools.RunJavaWithShellExecute,System.String .String 工作目录,System.String 错误)(位于 <4132c5c2cd7b45b09ef33302ae416489>:0)

Here is the full Error:这是完整的错误:

错误图像

I am not getting any solution on the internet as in Latest version of Unity 2019.1.6f1, JDK, Android SDK and NDK are installed within Unity (installed while installing Unity).我在互联网上没有得到任何解决方案,因为最新版本的 Unity 2019.1.6f1,JDK、Android SDK 和 NDK 安装在 Unity 中(安装 Unity 时安装)。

I have installed new Windows 10 in my another Drive and Installed same Unity Version in the new Windows 10. And it built successfully without any issue.我在另一个驱动器中安装了新的 Windows 10,并在新的 Windows 10 中安装了相同的 Unity 版本。它成功构建,没有任何问题。 However I am not able to build it on my current Operation System.但是我无法在我当前的操作系统上构建它。 Please help.请帮忙。

是的 gradle build 每次都会导致错误,将构建系统从“gradle”更改为“internal”。

I hope this helps someone because this took me forever to fix with no other solutions available online for this exact error message and multiple users reporting the issue.我希望这对某人有所帮助,因为这花了我永远的时间来修复,而没有其他在线解决方案可用于此确切的错误消息和多个用户报告该问题。

I think this problem might be caused by some type of permissions/file access problem.我认为这个问题可能是由某种类型的权限/文件访问问题引起的。 In my case my Unity project was located on a network share that was being synced for offline access.就我而言,我的 Unity 项目位于同步以供离线访问的网络共享上。 As soon as I copied the files to my local C:\\ drive the problem went away.一旦我将文件复制到本地 C:\\ 驱动器,问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Unity3D - 使用 Gradle 构建 Android AppBundle 失败 - Unity3D - failed Build Android AppBundle using Gradle 为 android 构建时,Gradle 为 unity 项目构建失败 - Gradle build failed for unity project when building for android Android Gradle 构建失败 - Android Gradle Build Failed Android build gradle失败,错误应用程序:transformClassesWithMultidexlistForDebug&#39; - Android build gradle failing, Error app:transformClassesWithMultidexlistForDebug' 当我要在Android Studio中构建android项目时,它显示在gradle控制台中构建成功。 但它报告错误 - When I am going to build android project in Android Studio, it shows build success in gradle console. But it reports error CommandInvokationFailure:Gradle 构建失败。 统一 - CommandInvokationFailure: Gradle build failed. Unity Android Studio 2.1.1中的Gradle构建失败:“ app:compileDebugJavaWithJavac”(错误的路径) - Gradle Build failed in Android Studio 2.1.1 : 'app:compileDebugJavaWithJavac' (wrong path) Unity 2020.3.xx Gradle 构建失败 - Unity 2020.3.xx Gradle build failed Unity 2021.3.4f1 Gradle 构建失败 - Unity 2021.3.4f1 Gradle Build failed Gradle构建错误:任务&#39;:app:prepareDebugDependencies&#39;的执行失败 - Gradle Build Error: Execution failed for task ':app:prepareDebugDependencies'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM