Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

cant build quest game

Discussion in 'Editor & General Support' started by daciansolgen, Jul 12, 2022.

  1. daciansolgen

    daciansolgen

    Joined:
    Mar 1, 2015
    Posts:
    2
    when building a quest project with 3d photoscan i get 3 errors when build and run

    error 1
    FileNotFoundException: Failed to find $C:/Program Files/Unity/Hub/Editor/2021.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\GradleTemplates\mainTemplate.gradle
    UnityEditor.Android.AndroidBuildPostprocessor.GetTemplate (System.String toolsPath, System.String fileName) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
    UnityEditor.Android.AndroidBuildPostprocessor+<GetDataForBuildProgramFor>d__21.MoveNext () (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
    UnityEditor.Modules.BeeBuildPostprocessor.SetupBeeDriver (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
    UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <0bc7e9c04c1540528b26863a0cb726ae>: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 <44a70d1b13cf47e29810e30f45ffae08>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    error 2
    Build completed with a result of 'Failed' in 16 seconds (15811 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    error 3
    UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <44a70d1b13cf47e29810e30f45ffae08>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <44a70d1b13cf47e29810e30f45ffae08>:0
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    please help me!!!
     
    AndrDarkLord and Mr_Htet like this.
  2. Eduarks

    Eduarks

    Joined:
    Jul 12, 2022
    Posts:
    1
    me too :(
     
  3. daciansolgen

    daciansolgen

    Joined:
    Mar 1, 2015
    Posts:
    2
    I found out that you have to downgrade to unity 2020 in order to get it to work since there seems to be a problem with grandle in the latest. now that im not a programmer i cant figure out on how to get it to work on latest version
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,711
    More generally...

    Android build not building:

    First, make a blank project with a single blank scene and prove that it builds successfully.

    If it does NOT build, then go fix your Unity installation, or your other tools, such as Android SDK, NDK, JDK, etc.

    Until you can build a blank project to the target platform, don't fiddle with anything else.

    Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

    Most often things that prevent building are third-party libraries such as Firebase.

    Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

    It may also be helpful to work through a tutorial or two for that subsystem.
     
    theoaraujo and Mr_Htet like this.
  5. Cidonix

    Cidonix

    Joined:
    Apr 21, 2015
    Posts:
    2
    It's because Unity developers forgot to include Tools folder
    c:\Program Files\Unity\Hub\Editor\2021.3.6f1\Editor\Data\Tools\
    I copied the Tools folder from another version of Unity there and everything works.
     
  6. xelink2146

    xelink2146

    Joined:
    Jan 23, 2013
    Posts:
    1
    Had the same problem just now (word for word exact 3 errors) and fixed it. Cidonix answer didn't work for me as that path is not the same one present in the error, but it put me on the right track. For your case do what I did:

    I created a "Tools" folder here:

    C:\Program Files\Unity\Hub\Editor\2021.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer

    I then copied the contents of this folder (containing GradleTemplates and a bunch of other stuff)

    C:\Program Files\Unity\Hub\Editor\2021.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\cmdline-tools\2.1

    Into my newly created Tools folder and it worked since it can now found the correct files at the correct location it is looking for.

    Try that - should fix it.
     
    Last edited: Jul 22, 2022
  7. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    86
    Can confirm the Unity Hub installer neglects to install the tools directory to this path:

    c:\Program Files\Unity\Hub\Editor\2021.3.6f1\Editor\Data\Tools\

    Copying over the directory from another recent Unity Editor installation will allow one to make Quest/Android builds again.

    Hopefully Unity fixes the 2021.3.6f1 installer bug ASAP!
     
    Lorrak likes this.
  8. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    38
    same, downloading 2021.3.3f with all android tools, then copying from it tools folder to 2021.3.6f fixed it
     
  9. Glowstickman

    Glowstickman

    Joined:
    Jul 25, 2022
    Posts:
    1
    Awesome, that works fine - what a fix xD
     
  10. spatialwb

    spatialwb

    Joined:
    Sep 26, 2019
    Posts:
    12
    I reported the bug to unity
     
  11. spatialwb

    spatialwb

    Joined:
    Sep 26, 2019
    Posts:
    12
    Looks like this is now fixed with the recent 2021.3.7f1 release
     
    brkyzdr and Lorrak like this.
  12. FieldStudio

    FieldStudio

    Joined:
    Jul 13, 2022
    Posts:
    1

    damm u really helped me thank you man... holy S*** ppl are smart
     
    AndrDarkLord likes this.
  13. Shami213

    Shami213

    Joined:
    Jul 17, 2022
    Posts:
    1
    Thanks a lot !!!
    It worked.
     
  14. AndrDarkLord

    AndrDarkLord

    Joined:
    Jul 22, 2022
    Posts:
    1

    Thanks a lot, it helped me!
    I would like to switch to a new version of the Unity engine...
    (This has been fixed in version 2021.3.8f1)
     
  15. tomchancat

    tomchancat

    Joined:
    May 31, 2019
    Posts:
    2
    Life savior ! Thanks community !
    And pls damn Unity, don't call it LTS if you engineers could mess up such simple things