Search Unity

Resolved Unity does not build, please help.

Discussion in 'VR' started by ferran_, Jul 8, 2022.

  1. ferran_

    ferran_

    Joined:
    Jun 27, 2022
    Posts:
    8
    Whenever I build/ build and run in unity(I have it set up to run on a quest 2, so android), i get the error log of "
    UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <50d8227720e74aff8e8fdaf830f782e9>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <50d8227720e74aff8e8fdaf830f782e9>:0
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    " and "
    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':launcher:mergeReleaseNativeLibs'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    > More than one file was found with OS independent path 'lib/arm64-v8a/libopenxr_loader.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studi...kaging_of_prebuilt_dependencies_used_by_cmake

    * 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

    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    " and "
    CommandInvokationFailure: Gradle build failed.
    C:\Program Files\Unity\Hub\Editor\2022.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':launcher:mergeReleaseNativeLibs'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    > More than one file was found with OS independent path 'lib/arm64-v8a/libopenxr_loader.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studi...kaging_of_prebuilt_dependencies_used_by_cmake

    * 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
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
    Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.1.7f1\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:preReleaseBuild UP-TO-DATE
    > Task :launcher:preReleaseBuild UP-TO-DATE
    > Task :unityLibrary:compileReleaseAidl NO-SOURCE
    > Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
    > Task :launcher:generateReleaseBuildConfig UP-TO-DATE
    > Task :launcher:compileReleaseAidl NO-SOURCE
    > Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
    > Task :launcher:compileReleaseRenderscript NO-SOURCE
    > Task :unityLibrary:generateReleaseResValues UP-TO-DATE
    > Task :unityLibrary:generateReleaseResources UP-TO-DATE
    > Task :launcher:javaPreCompileRelease UP-TO-DATE
    > Task :launcher:generateReleaseResValues UP-TO-DATE
    > Task :launcher:generateReleaseResources UP-TO-DATE
    > Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
    > Task :launcher:extractDeepLinksRelease UP-TO-DATE
    > Task :unityLibrary:packageReleaseResources UP-TO-DATE
    > Task :launcher:prepareLintJar UP-TO-DATE
    > Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
    > Task :unityLibrary:processReleaseManifest UP-TO-DATE
    > Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
    > Task :launcher:mergeReleaseResources UP-TO-DATE
    > Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
    > Task :launcher:processReleaseManifest UP-TO-DATE
    > Task :launcher:desugarReleaseFileDependencies UP-TO-DATE
    > Task :launcher:checkReleaseDuplicateClasses UP-TO-DATE
    > Task :unityLibrary:generateReleaseRFile UP-TO-DATE
    > Task :launcher:mergeReleaseShaders UP-TO-DATE
    > Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
    > Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
    > Task :launcher:processReleaseResources UP-TO-DATE
    > Task :launcher:mergeExtDexRelease UP-TO-DATE
    > Task :unityLibrary:compileReleaseJavaWithJavac UP-TO-DATE
    > Task :launcher:compileReleaseShaders NO-SOURCE
    > Task :unityLibrary:bundleLibCompileToJarRelease UP-TO-DATE
    > Task :launcher:generateReleaseAssets UP-TO-DATE
    > Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
    > Task :unityLibrary:bundleLibRuntimeToJarRelease UP-TO-DATE
    > Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
    > Task :unityLibrary:compileReleaseShaders NO-SOURCE
    > Task :launcher:compileReleaseJavaWithJavac UP-TO-DATE
    > Task :unityLibrary:generateReleaseAssets UP-TO-DATE
    > Task :launcher:compileReleaseSources UP-TO-DATE
    > Task :unityLibrary:packageReleaseAssets
    > Task :unityLibrary:processReleaseJavaRes NO-SOURCE
    > Task :unityLibrary:bundleLibResRelease NO-SOURCE
    > Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
    > Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
    > Task :unityLibrary:stripReleaseDebugSymbols UP-TO-DATE
    > Task :unityLibrary:copyReleaseJniLibsProjectOnly UP-TO-DATE
    > Task :launcher:lintVitalRelease
    > Task :launcher:dexBuilderRelease UP-TO-DATE
    > Task :launcher:mergeDexRelease UP-TO-DATE
    > Task :launcher:mergeReleaseAssets
    > Task :launcher:processReleaseJavaRes NO-SOURCE
    > Task :launcher:mergeReleaseJavaResource UP-TO-DATE
    > Task :launcher:collectReleaseDependencies UP-TO-DATE
    > Task :launcher:sdkReleaseDependencyData UP-TO-DATE
    > Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
    > Task :launcher:validateSigningRelease UP-TO-DATE
    > Task :launcher:mergeReleaseNativeLibs FAILED
    43 actionable tasks: 4 executed, 39 up-to-date
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <57714280d6774aa2a9d1c6016d353c12>: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 <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <57714280d6774aa2a9d1c6016d353c12>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, 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 <50d8227720e74aff8e8fdaf830f782e9>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
    " and "
    UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <50d8227720e74aff8e8fdaf830f782e9>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <50d8227720e74aff8e8fdaf830f782e9>:0
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    "
     
    KnightWhoSaysNi likes this.
  2. ferran_

    ferran_

    Joined:
    Jun 27, 2022
    Posts:
    8
    ps, the :p emogi is just the : followed by a p
     
  3. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Check if you have multiple files of libopenxr_loader in your project and disable (or delete) the one thats not required in inspector.
     
  4. ferran_

    ferran_

    Joined:
    Jun 27, 2022
    Posts:
    8
    ok, so I re-installed a fresh install of windows (due to an unrelated cause), but this seems to have fixed my issue, thanks though.
     
  5. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    you have that problem when you include 2 openxr libraries. For instance, in Unity if you have selected "oculus" on the XR settings, but it also uses OpenXR, they would collide. Since Oculus already includes its own openxr library.

    The easy way to fix it, in the xr settings of Unity, select OpenXR, do not select Oculus. That way you only get one library.
     
    q8sr and ThomFoxx like this.