Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Build fails when project is copied to a different directory or computer and compiled

Discussion in 'Editor & General Support' started by thelearningapplications, Jul 18, 2022.

  1. thelearningapplications

    thelearningapplications

    Joined:
    Apr 23, 2019
    Posts:
    4
    Hi, I am trying to compile a project for iOS. For this, I transferred the project files from my PC to a Mac and tried to compile there. However, build fails and it gives error that it is looking for some tundra.log.json file in the same directory structure as was on the case in my mac.

    For experiment, I did the same thing on the original windows PC (made a copy of my project and changed the name of original project) and got the same error.

    Exact error is this:

    tundra: error: Failed to open file "D:/balloonpop3_iOS_GoogleAds/balloonpopunitydd-F_FreeAppWork/Library/Il2cppBuildCache/iOS/buildstate/tundra.log.json" for structured logging

    Obviously it will not find this path on the mac. My guess is this has something to do with temp/cache files that have saved this as absolute path instead of relative. I just don't know how to fix it. Ive tried doing the "reimport all". Ive tried deleting the temp folder. Nothing seems to work.

    For a supposedly top tier game engine, unity sure makes the simple task of compiling the source on a different PC a hellish nightmare.

    My unity version is 2021.3.4f1 but it also fails with same error on 2021.3.5f1 which is the version on my mac.

    upload_2022-7-18_17-6-23.png
     

    Attached Files:

    LucreciaBonita likes this.
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    In General, if you copy over a project from one device to another, make sure to not copy the Library and cache folders.
     
    Last edited: Nov 21, 2022
  3. unity_408B3BB046165A2D1A27

    unity_408B3BB046165A2D1A27

    Joined:
    Nov 9, 2021
    Posts:
    1
    Are there some solutions for that?
     
  4. JumanhAtoum

    JumanhAtoum

    Joined:
    Apr 27, 2023
    Posts:
    1
    I am facing the same problem. Not sure why.. I tried to delete the library and cache folders, but I am still facing the same problem. Can someone explain the possible reasons for that error to occur in the first place and how to solve it?
     
  5. Dennis_eA

    Dennis_eA

    Joined:
    Jan 17, 2011
    Posts:
    380
    I have a feeling you are not using VC, but this questions needs to be answered: You said you copied over a project. So this is not in a repository and there is no .gitignore file in place?

    The following is (just a) part of my .gitignore (files that get ignored because they will be reimported when pulling a fresh copy..)
    Close the project and delete the following folders inside your project folder (* is the Project folder)

    /Unity/*/[Ll]ibrary/
    /Unity/*/[Tt]emp/
    /Unity/*/[Oo]bj/
    /Unity/*/[Bb]uild/
    /Unity/*/[Bb]uilds/
    /Unity/*/Assets/AssetStoreTools*

    /Unity/*/[Uu]serSettings/
    /Unity/*/[Ll]ogs/
     
    Last edited: Aug 3, 2023
    jbartelt and Uzair-Mahmood like this.
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,514
    Definitely first get the source control right. If you don't get that right, nothing else will work.

    PROPERLY CONFIGURING AND USING ENTERPRISE SOURCE CONTROL

    I'm sorry you've had this issue. Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.

    Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    I usually make a separate repository for each game, but I have some repositories with a bunch of smaller test games.

    Here is how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Generally the ONLY folders you should ever source control are:

    Assets/
    ProjectSettings/
    Packages/

    NEVER source control Library/ or Temp/ or Logs/
    NEVER source control anything from Visual Studio (.vs, .csproj, none of that noise)

    Setting git up with Unity (includes above .gitignore concepts):

    https://thoughtbot.com/blog/how-to-git-with-unity

    It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It's simply ridiculous not to back up.

    If you plan on joining the software industry, you will be required and expected to know how to use source control.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards
     
    Dennis_eA likes this.
  7. cahm29

    cahm29

    Joined:
    Feb 7, 2020
    Posts:
    7

    I faced the same problem. This approach worked for me. Thanks!
     
    Dennis_eA likes this.
  8. Pisceus

    Pisceus

    Joined:
    Sep 15, 2023
    Posts:
    1
    Thaks god you save me :)