无法建立任何APK

时间:2020-05-02 18:42:43

标签: unity3d

我无法在Unity中构建另一个APK。总是相同的错误。 SO:赢10 64位 Unity版本:带有Android Building Tools的2018.3.9f1

我仅用按钮创建一个空项目,然后尝试导出apk以尝试但 我收到此错误>>>

CommandInvokationFailure: Gradle build failed. 
C:/Program Files/Java/jdk1.8.0_251\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Failed to capture snapshot of output files for task ':mergeReleaseAssets' property 'outputDir' during up-to-date check.
    > Failed to create MD5 hash for file 'D:\Unity\TEST Game\test project\Temp\gradleOut\build\intermediates\merged_assets\release\mergeReleaseAssets\out\bin\Data\Managed\etc\mono\2.0\DefaultWsdlHelpGenerator.aspx' as it does not exist.

    * 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 24s
    ]
    stdout[
    :checkReleaseClasspath UP-TO-DATE
    :preBuild UP-TO-DATE
    :preReleaseBuild UP-TO-DATE
    :compileReleaseAidl NO-SOURCE
    :compileReleaseRenderscript UP-TO-DATE
    :checkReleaseManifest UP-TO-DATE
    :generateReleaseBuildConfig UP-TO-DATE
    :prepareLintJar UP-TO-DATE
    :mainApkListPersistenceRelease UP-TO-DATE
    :generateReleaseResValues UP-TO-DATE
    :generateReleaseResources UP-TO-DATE
    :mergeReleaseResources UP-TO-DATE
    :createReleaseCompatibleScreenManifests UP-TO-DATE
    :processReleaseManifest
    :splitsDiscoveryTaskRelease UP-TO-DATE
    :processReleaseResources
    :generateReleaseSources
    :javaPreCompileRelease UP-TO-DATE
    :compileReleaseJavaWithJavac UP-TO-DATE
    :compileReleaseNdk NO-SOURCE
    :compileReleaseSources UP-TO-DATE
    :lintVitalRelease
    :mergeReleaseShaders UP-TO-DATE
    :compileReleaseShaders UP-TO-DATE
    :generateReleaseAssets UP-TO-DATE
    :mergeReleaseAssets FAILED
    19 actionable tasks: 4 executed, 15 up-to-date
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <df7ba4d130594d168eec372b930522d4>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <df7ba4d130594d168eec372b930522d4>: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 <df7ba4d130594d168eec372b930522d4>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <df7ba4d130594d168eec372b930522d4>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <df7ba4d130594d168eec372b930522d4>:0)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

我的设置和尝试过的事情:

  • JDK 1.8版

  • SDK构建工具版本25

  • 从Gradle构建转换为内部构建(随着内部构建出现不同的错误)

  • 全部重新安装并重新启动计算机,问题仍然存在

2 个答案:

答案 0 :(得分:0)

您需要在电话编程器选项中启用USB调试

答案 1 :(得分:0)

这是一个奇怪的错误,似乎与Unity无关。

该过程无法找到此文件<script> import {dbLeaveYear} from '../stores/store' $: startDate = `20${$dbLeaveYear.slice(0, 2)}` $: endDate = `20${$dbLeaveYear.slice(-2)}` </script>

DefaultWsdlHelpGenerator

位于项目文件夹...'D:\Unity\TEST Game\test project\Temp\gradleOut\build\...\etc\mono\2.0\DefaultWsdlHelpGenerator.aspx' as it does not exist.

中的文件

作为路径上空格的朋友,我建议您尝试使用另一个在路径上没有空格的项目,并根据您的评论起作用!

ps; 因为这可能对其他人有帮助,所以我将此作为答案!