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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Error importing texture after upgrading to Unity 2023.1.2f1

Discussion in 'Editor & General Support' started by athensM, Jul 1, 2023.

  1. athensM

    athensM

    Joined:
    Mar 18, 2021
    Posts:
    10
    After upgrading to Unity 2023.1.2f1, whenever I import a texture, the console will get spammed with

    UnityException: Could not find the requested Platform Texture Settings. This is incorrect, did initialization fail?
    UnityEditor.TextureImportPlatformSettings.CacheSerializedProperties (UnityEditor.SerializedProperty platformSettingsArray) (at <5f5588e61bcc4b419b651997708c8945>:0)
    UnityEditor.TextureImporterInspector.<OnInspectorGUI>b__118_1 (UnityEditor.TextureImportPlatformSettings settings) (at <5f5588e61bcc4b419b651997708c8945>:0)
    System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) (at <0de99929796b4095b47389e59e446fbd>:0)
    UnityEditor.TextureImporterInspector.OnInspectorGUI () (at <5f5588e61bcc4b419b651997708c8945>:0)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <5f5588e61bcc4b419b651997708c8945>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    Screenshot 2023-07-02 023723.png

    non-stop whenever I mouse-over anything in the inspector. Additionally, in the inspector, the place where the platform specific overrides normally should be, is empty.

    The textures that have been imported before upgrading to Unity 2023.1.2f1 work fine. However, if I import that same texture while using Unity 2023.1.2f1, the error messages get spammed. In fact, any new texture I try to import will get spammed with that message.

    Please assist and advice, thanks!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,970
    You could try a reimport-all on your project panel.

    If that doesn't fix it, you'll need to do a blank project experiment to verify if it is Unity that is having the problem, or some other importer script already in your project that is no longer compatible.

    ISSUES RELATED TO UPGRADING PROJECTS (eg, changing to a higher Unity version)

    Upgrading to a later version of Unity is a one-way process. Any project that has been updated should NEVER be reverted to an earlier version of Unity because this is expressly not supported by Unity. Doing so exposes your project to internal inconsistencies and breakage that may actually be impossible to repair.

    If you want to upgrade to a newer version of Unity, do not even consider it until you have placed your project fully under proper source control. This goes double or triple for non-LTS (Tech Stream) versions of Unity3D, which can be extremely unstable compared with LTS.

    Once you have source-controlled your project then you may attempt a Unity upgrade. Immediately after any attempted upgrade you should try to view as much of your project as possible, with a mind to looking for broken animations or materials or any other scripting errors or runtime issues.

    After an upgrade you should ALWAYS build to all targets you contemplate supporting: iOS and Android can be particularly finicky, and of course any third party libraries you use must also "play nice" with the new version of Unity. Since you didn't write the third party library, it is up to you to vet it against the new version to make sure it still works.

    If there are issues in your testing after upgrading Unity, ABANDON the upgrade, revert your project in source control and be back where you were pre-upgrade with the earlier version of Unity.

    Obviously the less you test after the upgrade the more chance you will have of an undiscovered critical issue.

    This risk of upgrading is entirely on you and must be considered whenever you contemplate a Unity version upgrade.

    Do not upgrade "just for fun" or you may become very unhappy.

    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
     
  3. RyanGarber

    RyanGarber

    Joined:
    May 20, 2021
    Posts:
    11
    I just started having this issue. It did not begin after an upgrade, but during regular use of 2023.1 (final release.) I do not have any custom importers. Reimporting does not help.

    Not sure why you felt the need to be so condescending, @Kurt-Dekker, as OP was not rude. You have no idea whether or not he has VCS. He was simply reporting a bug. You chose to go on a conceited rant filled with generic knowledge, and a demeaning attitude for no conceivable reason. If you were genuinely trying to help, I'm sorry. I just cannot shake the feeling that you think of yourself as smarter than this guy. The wall of text portrayed as wildly meaningful "insider" knowledge was painful to read.

    Edit: I did some testing and found the issue. One of the required platforms are not being added to Unity's .meta files. By adding
    Code (csharp):
    1.   - serializedVersion: 3
    2.     buildTarget: Server
    3.     maxTextureSize: 2048
    4.     resizeAlgorithm: 0
    5.     textureFormat: -1
    6.     textureCompression: 1
    7.     compressionQuality: 50
    8.     crunchedCompression: 0
    9.     allowsAlphaSplitting: 0
    10.     overridden: 0
    11.     androidETC2FallbackOverride: 0
    12.     forceMaximumCompressionQuality_BC6H_BC7: 0
    I have fixed the issue. Your required platform(s) may be different. Find a working texture in your project and copy any missing platforms from its .meta file.
     
    Last edited: Jul 1, 2023
  4. athensM

    athensM

    Joined:
    Mar 18, 2021
    Posts:
    10

    Hi RyanGarber,

    Thanks! This has worked. Specifically it was missing the "Server" platform in its ".meta" file, as per your example. After adding that section into the ".meta" file, the errors stop appearing.

    For anyone looking for the step-by-step:

    1. From your Unity project, look for a texture that has no errors.

    2. Look for its ".meta" file. You can do this by right-clicking on the texture -> "Show in Explorer", which will bring up your system's file explorer, then the ".meta" file should be next to the texture file.

    3. Open the ".meta" file with a text editor (I used SublimeText).

    4. Scroll down to the section for
    Code (csharp):
    1. platformSettings:
    .

    5. Go back to Unity, import a texture that has the errors.

    6. Open this texture's ".meta" file also.

    7. Compare the
    Code (csharp):
    1. platformSettings:
    content of these two ".meta" files. For the texture with errors, add in the missing platform. For me, this is
    Code (csharp):
    1.  
    2.   - serializedVersion: 3
    3.     buildTarget: Server
    4.     maxTextureSize: 8192
    5.     resizeAlgorithm: 0
    6.     textureFormat: -1
    7.     textureCompression: 1
    8.     compressionQuality: 50
    9.     crunchedCompression: 0
    10.     allowsAlphaSplitting: 0
    11.     overridden: 0
    12.     androidETC2FallbackOverride: 0
    13.     forceMaximumCompressionQuality_BC6H_BC7: 0




    Thanks again, RyanGarber!
     
    algemayelkhalil likes this.
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,970
    That is entirely in your head. You are misreading perfunctory technical advice by thinking you can read my mind and imagining in some way my words indicate condescension.

    Humans cannot read each others minds. That's not a thing. It's a very popular illusion however, one that is actively fostered by TV news and the media at large. But it's still not a thing.
     
  6. Shinobi1507

    Shinobi1507

    Joined:
    Sep 8, 2010
    Posts:
    220
    I'll be honest, I took it that way too, but to be specific its just because of the large amount of assumptions you made. Like you said, no one can read your mind so all Ryan had to go on was what you presented, and what you presented made it seem condescending. All good, all you can do in this case is clarify and move on, felt you deserved a specific clarification.

    In this case, RyanGarber's technical advice was also correct. I'm having this issue as well and the meta files that Unity is generating appear to be causing the issues.
     
  7. Loden_Heathen

    Loden_Heathen

    Joined:
    Sep 1, 2012
    Posts:
    456
    We ran into the same issue,
    We actually didn't have an image in the project that didn't have this issue so we simply added the builtTarget: Server section as shown in the quote above and that sorted it.

    On further digging around seems it is a known bug with Unity in HDRP projects with Dedicated Server module present
     
    unlikelysurvival likes this.
  8. Shinobi1507

    Shinobi1507

    Joined:
    Sep 8, 2010
    Posts:
    220
    Did you find a programmatic way of fixing this cleanly in Unity? We are just using this version for a jam project so we wrote a crappy python script to just pop it into any meta file but I'd love a better way.
     
  9. algemayelkhalil

    algemayelkhalil

    Joined:
    Jan 4, 2023
    Posts:
    2
    Thank You for the clarification man! you are awesome!
     
  10. damonro

    damonro

    Joined:
    Sep 19, 2020
    Posts:
    2
    I have been having the same problem, and I finally solved it by changing from this:

    3. buildTarget: DefaultTexturePlatform

    to this:

    3. buildTarget: Server

    as you said.

    The problem now is that I have more than 500 sprites in my project with the same problem, and I wonder if is there a way of not to do it one by one.