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.

Bug TTF import error every time target platform switches

Discussion in 'UGUI & TextMesh Pro' started by SI-Shawn, Sep 28, 2021.

  1. SI-Shawn

    SI-Shawn

    Joined:
    Jun 30, 2021
    Posts:
    12
    Unity v2020.3.17f1, TMP v3.0.6

    Every time we switch the target platform the following error is logged for all of our TTF assets:
    The asset at Assets/Art/UI/Fonts/Barlow/Barlow-BlackItalic.ttf has been scheduled for reimport during the Refresh loop and Loading of it has been attempted.
    Doing this can lead to the AssetDatabase returning two versions of the same asset.
    Please ensure that code which attempts to reimport this asset does not run while the editor is Refreshing.
    You can do so by checking the value of EditorApplication.isUpdating

    We have no custom importers for these assets.

    Has anyone seen this?
     
    tt6tt08233 likes this.
  2. AndyDBell

    AndyDBell

    Joined:
    Nov 7, 2018
    Posts:
    2
    Unity v2020.3.18f1,

    Same problem -

    The asset at Assets/UI - BUILDER/Source Files/Fonts/OpenSans-Familiy/OpenSans-BoldItalic.ttf has been scheduled for reimport during the Refresh loop and Loading of it has been attempted.
    Doing this can lead to the AssetDatabase returning two versions of the same asset.
    Please ensure that code which attempts to reimport this asset does not run while the editor is Refreshing.
    You can do so by checking the value of EditorApplication.isUpdating
     
  3. BasicallyGames

    BasicallyGames

    Joined:
    Aug 31, 2018
    Posts:
    91
    Unity 2020.3.26/2020.3.27

    This has been happening to me on occasion when changing GIT branches. In my case it's not related to TMP, but still seems to be a similar issue. Sometimes seems to cause weird issues with my prefabs. When it does, I need to delete my Library folder to fix it.

    First I get this several times in a row:

    The asset at Assets/Prefabs/UI/Menu/Options.prefab has been scheduled for reimport during the Refresh loop and Loading of it has been attempted.
    Doing this can lead to the AssetDatabase returning two versions of the same asset.
    Please ensure that code which attempts to reimport this asset does not run while the editor is Refreshing.
    You can do so by checking the value of EditorApplication.isUpdating


    Then this:

    Problem detected while importing the Prefab file: 'Assets/Prefabs/Singletons/CoreGameManager.prefab'.
    The file might be corrupt or have missing nested Prefabs. See details below.
    Errors:
    Prefab instance problem: Options (Missing Prefab with guid: 573131f9fafc0c34fa9c4d818a85dce0)
     
    Last edited: Feb 8, 2022
  4. toantranaviron

    toantranaviron

    Joined:
    Nov 16, 2021
    Posts:
    1
    Still happen in Unity 2021.1.22
    It seems do not affect anything but it's still a bug
     
  5. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    bump.
    Unity 2021.2.11.
     
  6. SaulChow

    SaulChow

    Joined:
    Mar 23, 2021
    Posts:
    10
    2020.3.30f1c1 LTS still has this bug.
    Due the reason I can not create AssetBundles. May be it has some relationship with version control.
    We use PlasticSCM, but one of my teammate doesn't has this issue.
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The issue could be related to some Library cache issue. I would suggested closing Unity and deleting the Library folder. Note that depending on the size of the project, re-opening Unity might take a while as all resources / assets get re-imported.

    Let me know if that resolves the issue.
     
    taedal5 likes this.
  8. taedal5

    taedal5

    Joined:
    Feb 2, 2021
    Posts:
    11
    I had same problem after switching git branches and deleting Library resolved. (Unity 2020.3.33f1)
     
    Stephan_B likes this.
  9. SaulChow

    SaulChow

    Joined:
    Mar 23, 2021
    Posts:
    10
    Thank you for reply.
    I tried deleting the Library folder and re-opening project.
    But the issue is still there.
    And I found that even if the error message displayed, but the asset bundles were built normally...No assets missing.
    It seems like the issue doesn't cause anything wrong just show you the error message.

    BTW, I updated to 2020.3.32f1c1.
     
  10. luvcraft

    luvcraft

    Joined:
    Aug 22, 2011
    Posts:
    60
    I've had this issue for 2 years now, and was checking in here to see if there's a solution yet but apparently not.

    It used to only happen when I changed platforms via script, but now it happens if I change platforms via the Build Settings window as well.

    Happens on both Mac and Windows.
     
  11. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    I've also been having this problem now, on 2020.3.26f1. Also found that there are errors specifically with font files like the examples here and also seeing no issues with the build either. It's probably just something that can be ignored but it's not very clean with this stuff popping up and makes me concerned for potential hidden issues. I was hoping to avoid random errors going off like this.

    Can also report that I started noticing it when using BuildPipeline.BuildPlayer which internally seems to call a target switch. After that I tried target switching manually from the build menu but I still saw it when I switched to the Mac platform. Then when switching manually to Linux it didn't happen(?) So maybe it's just random and/or happens on the first switch when Unity runs? Not sure about the specifics, but I can try clearing out my Library folder like was suggested.
     
  12. iyadik

    iyadik

    Joined:
    Sep 25, 2015
    Posts:
    4
    Hello All,
    Its resolved by deleteting the folder Library!! I use Unity version LTS 2020.3.34f1

    Close unity > then delete the folder Library > re-open the project

    Hope its helpful!!
     
    tt6tt08233 likes this.
  13. drzepa

    drzepa

    Joined:
    Jul 23, 2021
    Posts:
    3
    I can't believe the response to this bug is to delete the Library folder. What a cop out.

    Even with the Unity accelerator, a fresh import of our project takes hours. We can't afford to do that with every build.

    This bug absolutely is causing problems - it causes AssetDatabase.LoadAsset to return null which breaks some of our pre-processing...
     
  14. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Just had another user run into this issue where temporarily changing the font name in the Font Name array element 0 resolved the issue.

    upload_2022-11-8_13-25-42.png

    I suspect that doing the above or perhaps changing other properties of the font does result in updating the cache data in the Library cache.

    Let me know if the above worked in your cases?
     
  15. EricJ13

    EricJ13

    Joined:
    Feb 28, 2009
    Posts:
    354
    I was having this problem so after reading this post I closed Unity (2021.3.17f1) and deleted my Library folder. When I re-launched I got many, many errors. So I deleted the local project and re-downloaded from GitHub. Same errors. Package manager errors out and won't open. :mad:

    I was supposed to send this app to beta testing at COB. I guess that's not happening, since it looks like I'm going to have to start from scratch. No biggie, only several weeks of work lost. :(
     
    Jom000 likes this.
  16. ccesar

    ccesar

    Joined:
    Feb 3, 2023
    Posts:
    1
    I had this problem with the font assets while changing platform, to solve it I closed the project and changed the target platform in Unity Hub from "Current Platform" to the device I was building for, hope it helps =D
     
    ldoppertin likes this.
  17. Unityzkcmkj

    Unityzkcmkj

    Joined:
    Jul 22, 2020
    Posts:
    2
    My situation is that I made this error while packaging the assetbundle, and later found out that it was caused by the inconsistency between the selected platform and the platform packaged by the script. I switched the Mac to Windows and there was no error.
     
  18. unity_QJ7RazXzghZCzA

    unity_QJ7RazXzghZCzA

    Joined:
    Jul 9, 2021
    Posts:
    101
    Are you suggesting we do a re-import every time we switch branches or something like that? This is crazy, I'll lose HOURS waiting for a re-import with my mid-end hardware!
     
    Last edited: May 20, 2023
  19. LeeGichang10

    LeeGichang10

    Joined:
    May 8, 2022
    Posts:
    1
  20. benjamin_thegoodevil

    benjamin_thegoodevil

    Joined:
    Aug 5, 2020
    Posts:
    16
  21. jl11935

    jl11935

    Joined:
    Sep 8, 2022
    Posts:
    1
    Also had the same bug (suspect related to TMP), and I changed "Build Settings" from Windows to WebGL (which is what I was going to build in), and the error message disappear by it self.
    I do not know enough to know what is happening, but just to provide additional reference.