Search Unity

How Unity switch platform (in Build Setting menu)

Discussion in 'Editor & General Support' started by Sompol_Rznet, Aug 28, 2019.

  1. Sompol_Rznet

    Sompol_Rznet

    Joined:
    Sep 14, 2018
    Posts:
    22
    Hi,

    Now I'm using Unity 2018.4.3f1
    My team facing with Unity bug almost everyday, about target platform that we can see in the Build Setting panel.

    It's the same issue that in this following topics : https://forum.unity.com/threads/bui...orted-switch-to-windows-or-exit-unity.625336/

    Which is didn't get official solution or workaround yet. And the issue slow down our project.
    Because we thinks that we need to reinstall the Android and iOS build support everytime it's happen.

    However, I found some new information about this issue.
    When the issue occur. I open new Unity windows (the same version that cause the problem) then create new project.

    In that new project, the issues not exist (at the moment). We still can see an Android and iOS build target platform properly.

    But in our main project that we hit the issue. It's always still there.

    So, the root cause must hide in the project folder, not in the Unity program directory.

    Therefore, I need to know which file in the Unity project that use as configuration for current target build platform.
    If I found the work around, this would save a lot of time for re-installing those Android and iOS build support.
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    In cases like this, attaching Editor.log might help
     
  3. Sompol_Rznet

    Sompol_Rznet

    Joined:
    Sep 14, 2018
    Posts:
    22
    Hi,

    I just found a workaround by myself.

    In root folder of the Unity project that have a problem. There should be following file or something similar.

    • Unity.Analytics.DataPrivacy.csproj
    • Unity.CollabProxy.Editor.csproj
    • Unity.PackageManagerUI.Editor.csproj
    • Unity.TextMeshPro.csproj
    In these file, some following section are missing when the issue occurring.


    <Reference Include="UnityEditor.Android.Extensions">
    <HintPath>C:/Program Files/Unity 2018.4.3f1/Editor/Data/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
    </Reference>
    <Reference Include="UnityEditor.iOS.Extensions">
    <HintPath>C:/Program Files/Unity 2018.4.3f1/Editor/Data/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll</HintPath>
    </Reference>

    ..
    ..
    ..
    <Reference Include="UnityEditor.iOS.Extensions.Xcode">
    <HintPath>C:/Program Files/Unity 2018.4.3f1/Editor/Data/PlaybackEngines/iOSSupport\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
    </Reference>
    <Reference Include="UnityEditor.iOS.Extensions.Common">
    <HintPath>C:/Program Files/Unity 2018.4.3f1/Editor/Data/PlaybackEngines/iOSSupport\UnityEditor.iOS.Extensions.Common.dll</HintPath>
    </Reference>


    To fixs the issue, just bring back those setting back in to those file, then restart Unity with that project again.
    For me the issue was solved by this method.

    P.S. More experiment. I deleted those file our from my project, and my game still works without error.
     
  4. Sompol_Rznet

    Sompol_Rznet

    Joined:
    Sep 14, 2018
    Posts:
    22
    Another workaround is.

    I just found that when we working and had both Unity and Visual-Studio (2017 for me) running in the same time. If we always close the VS before Unity. This issue would never happen again.
     
  5. huoyanxu

    huoyanxu

    Joined:
    Jun 23, 2018
    Posts:
    2
    unity hub logout ,login again,that‘s OK,trust me :)