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

Entities 0.8 Compile Error in android platform

Discussion in 'Entity Component System' started by Opeth001, Mar 14, 2020.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,078
    Hello Unity!

    there is a Compile Error when the Entities 0.8 Package and switching to Android platform.(reproduced in an empty project)

    Errore:
    Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\LiveLink\LiveLinkPlayerSystemGroup.cs(53,48): error CS0103: The name 'bootstrapFilePath' does not exist in the current context

    Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\LiveLink\LiveLinkPlayerSystemGroup.cs(32,59): error CS0117: 'SceneSystem' does not contain a definition for 'GetBootStrapPath'
     
  2. gianpdev

    gianpdev

    Joined:
    Jul 9, 2019
    Posts:
    2
    Found temporary fix:
    Need to modify LiveLinkPlayerSystemGroup.cs and SceneSystem.cs

    LiveLinkPlayerSystemGroup.cs
    In "LiveLinkPlayerSystemGroup.cs" (Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\LiveLink\LiveLinkPlayerSystemGroup.cs)

    Move var bootstrapFilePath = GetBootStrapPath(); above #if UNITY_ANDROID
    Before:
    Code (CSharp):
    1.         protected override void OnCreate()
    2.         {
    3. #if UNITY_ANDROID
    4.             var uwrFile = new UnityWebRequest(SceneSystem.GetBootStrapPath());
    5.             uwrFile.SendWebRequest();
    6.             while(!uwrFile.isDone) {}
    7.  
    8.             if (uwrFile.isNetworkError || uwrFile.isHttpError)
    9.             {
    10.                 Enabled = false;
    11.             }
    12.             else
    13.             {
    14.                 Enabled = true;
    15.             }
    16. #else
    17.             var bootstrapFilePath = GetBootStrapPath(); //<----- This (Line 45)
    18.             Enabled = File.Exists(bootstrapFilePath);
    19. #endif
    After:
    Code (CSharp):
    1.         protected override void OnCreate()
    2.         {
    3.             var bootstrapFilePath = GetBootStrapPath(); //<----- To here (Line 31)
    4. #if UNITY_ANDROID
    5.             var uwrFile = new UnityWebRequest(SceneSystem.GetBootStrapPath());
    6.             uwrFile.SendWebRequest();
    7.             while(!uwrFile.isDone) {}
    8.  
    9.             if (uwrFile.isNetworkError || uwrFile.isHttpError)
    10.             {
    11.                 Enabled = false;
    12.             }
    13.             else
    14.             {
    15.                 Enabled = true;
    16.             }
    17. #else
    18.             Enabled = File.Exists(bootstrapFilePath);
    19. #endif

    SceneSystem.cs
    In "SceneSystem.cs" (Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\SceneSystem.cs)

    Add static internal string GetBootStrapPath() method and add k_BootstrapFileName string variable
    Before:
    Code (CSharp):
    1.     public class SceneSystem : ComponentSystem
    2.     {
    3.         public const string k_SceneInfoFileName = "catalog.bin";
    4.  
    5.         static internal string GetSceneInfoPath()
    6.         {
    7.             return Path.Combine(Application.streamingAssetsPath, k_SceneInfoFileName);
    8.         }
    After:
    Code (CSharp):
    1.     public class SceneSystem : ComponentSystem
    2.     {
    3.         public const string k_BootstrapFileName = "livelink-bootstrap.txt"; //<------ This line
    4.         public const string k_SceneInfoFileName = "catalog.bin";
    5.         //This function below
    6.         static internal string GetBootStrapPath()
    7.         {
    8.             return Path.Combine(Application.streamingAssetsPath, k_BootstrapFileName);
    9.         }
    10.         //-----------------------------
    11.         static internal string GetSceneInfoPath()
    12.         {
    13.             return Path.Combine(Application.streamingAssetsPath, k_SceneInfoFileName);
    14.         }

    Packages used (doing android VR):
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.animation.rigging": "0.2.6-preview",
    4.     "com.unity.burst": "1.3.0-preview.6",
    5.     "com.unity.collab-proxy": "1.2.16",
    6.     "com.unity.collections": "0.7.0-preview.2",
    7.     "com.unity.dots.editor": "0.3.0-preview",
    8.     "com.unity.entities": "0.8.0-preview.8",
    9.     "com.unity.ide.rider": "1.1.4",
    10.     "com.unity.ide.vscode": "1.2.0",
    11.     "com.unity.inputsystem": "1.0.0-preview.6",
    12.     "com.unity.mobile.android-logcat": "1.1.0",
    13.     "com.unity.netcode": "0.1.0-preview.6",
    14.     "com.unity.performance.profile-analyzer": "0.6.0-preview.1",
    15.     "com.unity.physics": "0.3.0-preview.1",
    16.     "com.unity.platforms": "0.2.1-preview.7",
    17.     "com.unity.platforms.android": "0.2.1-preview.7",
    18.     "com.unity.platforms.windows": "0.2.1-preview.7",
    19.     "com.unity.probuilder": "4.2.3",
    20.     "com.unity.progrids": "3.0.3-preview.5",
    21.     "com.unity.quicksearch": "1.5.2",
    22.     "com.unity.render-pipelines.universal": "7.2.1",
    23.     "com.unity.rendering.hybrid": "0.4.0-preview.8",
    24.     "com.unity.scriptablebuildpipeline": "1.6.5-preview",
    25.     "com.unity.settings-manager": "1.0.2",
    26.     "com.unity.test-framework": "1.1.11",
    27.     "com.unity.test-framework.performance": "2.0.8-preview",
    28.     "com.unity.textmeshpro": "2.0.1",
    29.     "com.unity.timeline": "1.2.13",
    30.     "com.unity.ugui": "1.0.0",
    31.     "com.unity.xr.interaction.toolkit": "0.9.3-preview",
    32.     "com.unity.xr.legacyinputhelpers": "1.3.11",
    33.     "com.unity.xr.management": "3.0.6",
    34.     "com.unity.xr.oculus": "1.2.0",
    35.     "com.unity.modules.ai": "1.0.0",
    36.     "com.unity.modules.androidjni": "1.0.0",
    37.     "com.unity.modules.animation": "1.0.0",
    38.     "com.unity.modules.assetbundle": "1.0.0",
    39.     "com.unity.modules.audio": "1.0.0",
    40.     "com.unity.modules.cloth": "1.0.0",
    41.     "com.unity.modules.director": "1.0.0",
    42.     "com.unity.modules.imageconversion": "1.0.0",
    43.     "com.unity.modules.imgui": "1.0.0",
    44.     "com.unity.modules.jsonserialize": "1.0.0",
    45.     "com.unity.modules.particlesystem": "1.0.0",
    46.     "com.unity.modules.physics": "1.0.0",
    47.     "com.unity.modules.physics2d": "1.0.0",
    48.     "com.unity.modules.screencapture": "1.0.0",
    49.     "com.unity.modules.terrain": "1.0.0",
    50.     "com.unity.modules.terrainphysics": "1.0.0",
    51.     "com.unity.modules.tilemap": "1.0.0",
    52.     "com.unity.modules.ui": "1.0.0",
    53.     "com.unity.modules.uielements": "1.0.0",
    54.     "com.unity.modules.umbra": "1.0.0",
    55.     "com.unity.modules.unityanalytics": "1.0.0",
    56.     "com.unity.modules.unitywebrequest": "1.0.0",
    57.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    58.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    59.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    60.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    61.     "com.unity.modules.vehicles": "1.0.0",
    62.     "com.unity.modules.video": "1.0.0",
    63.     "com.unity.modules.vr": "1.0.0",
    64.     "com.unity.modules.wind": "1.0.0",
    65.     "com.unity.modules.xr": "1.0.0"
    66.   }
    67. }
    68.  

    Tested using my current project, I'm not using LiveLink, so not sure if that's working, but it builds and runs successfully.

    Edit: Just found out that packages revert themselves when you close then reopen the editor, so you have to modify these every time you reopen the editor
     
    Last edited: Mar 14, 2020
    Pauleta, mangax, darkgap and 3 others like this.
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,078
    it works! thanks :)
     
  4. maylocnuoc

    maylocnuoc

    Joined:
    Dec 4, 2017
    Posts:
    2
    Can you show me how to fix it "
    Entities 0.8 Compile Error in android platform
    Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Scenes.Hybrid\LiveLink\LiveLinkPlayerSystemGroup.cs(32,59): error CS0117: 'SceneSystem' does not contain a definition for 'GetBootStrapPath'


    thanks
     
  5. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    yes ...
    its definitely horrible :[
     
    Nikita500 likes this.
  6. gianpdev

    gianpdev

    Joined:
    Jul 9, 2019
    Posts:
    2
    Open the SceneSystem.cs and LiveLinkPlayerSystemGroup.cs files (by searching in the Project tab for "SceneSystem" and "LiveLinkPlayerSystemGroup" with In Packages selected), then do the solution I provided my previous post:

    You have to change both files every time you reopen your project, until this is updated.
     
  7. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,655
    Or just move it to Packages folder from PackagesCache and it will made package local and would't change it automatically.
     
    darkgap, Opeth001, gianpdev and 2 others like this.
  8. maylocnuoc

    maylocnuoc

    Joined:
    Dec 4, 2017
    Posts:
    2
    đây là manifest.json của tôi

    {
    "phụ thuộc": {
    "com.unity.2d.animation": "3.1.1",
    "com.unity.2d.pixel-perfect": "2.0.4",
    "com.unity.2d.sheetimporter": "2.1.0",
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.2d.spriteshape": "3.0.8",
    "com.unity.2d.tilemap": "1.0.0",
    "com.unity.ads": "3.4.4",
    "com.unity.analytics": "3.3.5",
    "com.unity.burst": "1.3.0-preview.7",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.entities": "0.8.0-preview.8",
    "com.unity.ext.nunit": "1.0.0",
    "com.unity.ide.rider": "1.1.4",
    "com.unity.ide.vscode": "1.1.4",
    "com.unity.purchasing": "2.0.6",
    "com.unity.test-framework": "1.1.11",
    "com.unity.textmeshpro": "2.0.1",
    "com.unity.timeline": "1.2.13",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }


    this is scenesystem.cs

    {
    "dependencies": {
    "com.unity.2d.animation": "3.1.1",
    "com.unity.2d.pixel-perfect": "2.0.4",
    "com.unity.2d.psdimporter": "2.1.0",
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.2d.spriteshape": "3.0.8",
    "com.unity.2d.tilemap": "1.0.0",
    "com.unity.ads": "3.4.4",
    "com.unity.analytics": "3.3.5",
    "com.unity.burst": "1.3.0-preview.7",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.entities": "0.8.0-preview.8",
    "com.unity.ext.nunit": "1.0.0",
    "com.unity.ide.rider": "1.1.4",
    "com.unity.ide.vscode": "1.1.4",
    "com.unity.purchasing": "2.0.6",
    "com.unity.test-framework": "1.1.11",
    "com.unity.textmeshpro": "2.0.1",
    "com.unity.timeline": "1.2.13",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }


    this is my LiveLinkPlayerSystemGroup.cs


    using System;
    using System.IO;
    using Unity.Entities;
    using UnityEngine;
    using UnityEngine.Networking;
    using Hash128 = Unity.Entities.Hash128;

    namespace Unity.Scenes
    {

    //@todo: #ifdefs massively increase iteration time right now when building players (Should be fixed in 20.1)
    // Until then always have the live link code present.
    #if UNITY_EDITOR
    [DisableAutoCreation]
    #endif
    [ExecuteAlways]
    [UpdateInGroup(typeof(InitializationSystemGroup))]
    [UpdateBefore(typeof(SceneSystemGroup))]
    class LiveLinkRuntimeSystemGroup : ComponentSystemGroup
    {
    public const string k_BootstrapFileName = "livelink-bootstrap.txt";
    public static long LiveLinkSessionId { get; private set; }

    internal static string GetBootStrapPath()
    {
    return Path.Combine(Application.streamingAssetsPath, k_BootstrapFileName);
    }

    protected override void OnCreate()
    {
    #if UNITY_ANDROID
    var uwrFile = new UnityWebRequest(SceneSystem.GetBootStrapPath());
    uwrFile.SendWebRequest();
    while(!uwrFile.isDone) {}

    if (uwrFile.isNetworkError || uwrFile.isHttpError)
    {
    Enabled = false;
    }
    else
    {
    Enabled = true;
    }
    #else
    var bootstrapFilePath = GetBootStrapPath();
    Enabled = File.Exists(bootstrapFilePath);
    #endif
    if (Enabled)
    {
    if (!UnityEngine.Networking.PlayerConnection.PlayerConnection.instance.isConnected)
    Debug.LogError ("Không thể kết nối với Trình chỉnh sửa. \ N Cần có kết nối Trình chỉnh sửa để LiveLink hoạt động.");

    bằng cách sử dụng (varrdr = File.OpenText (bootstrapFilePath))
    {
    var buildConfigurationGUID = new Hash128 (rdr.ReadLine ());
    LiveLinkSessionId = long.Pude (rdr.ReadLine () ?? ném Ngoại lệ mới ("Dòng dự kiến trong bootstrap chứa id phiên!"));
    World.GetOrCreateSystem <SceneSystem> (). BuildConfigurationGUID = buildConfigurationGUID;
    }
    }
    }
    }
    } [/ mã]
     
  9. Ethan_Lin

    Ethan_Lin

    Joined:
    Oct 4, 2019
    Posts:
    3
    thanks for your sharing
    it works for me.
     
  10. surits14

    surits14

    Joined:
    Jan 22, 2018
    Posts:
    22
    Which one are you suggesting to move from PackagesCache to the Packages folder?
     
  11. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Most likely
    Library\PackageCache\com.unity.entities@0.8.0-preview.8
    ? :oops:
     
    surits14 likes this.
  12. Enrico-Monese

    Enrico-Monese

    Joined:
    Dec 18, 2015
    Posts:
    77
    Just reported this (case number 1232718)
     
    Opeth001 likes this.
  13. darkgap

    darkgap

    Joined:
    Aug 10, 2018
    Posts:
    2
    If you're not interested about LiveLink functionality ( I'm not using it too ), you could only remove "SceneSystem.", just after #if UNITY_ANDROID.

    The file then would looks like so:
    Code (CSharp):
    1. protected override void OnCreate()
    2.         {
    3.          var bootstrapFilePath = GetBootStrapPath(); // <--as said, this is moved from below.
    4. #if UNITY_ANDROID
    5.             var uwrFile = new UnityWebRequest(GetBootStrapPath()); // <-- here the "SceneSystem." is removed.
    6.             uwrFile.SendWebRequest();
    7.             while(!uwrFile.isDone) {}
    8.  
    9.             if (uwrFile.isNetworkError || uwrFile.isHttpError)
    10.             {
    11.                 Enabled = false;
    12.             }
    13.             else
    14.             {
    15.                 Enabled = true;
    16.             }
    17. #else
    18.          Enabled = File.Exists(bootstrapFilePath);
    19. #endif
    20.             if (Enabled)
    21.             {
    22.                 if (!UnityEngine.Networking.PlayerConnection.PlayerConnection.instance.isConnected)
    23.                     Debug.LogError("Failed to connect to the Editor.\nAn Editor connection is required for LiveLink to work.");
    24.              
    25.                 using (var rdr = File.OpenText(bootstrapFilePath))
    26.                 {
    27.                     var buildConfigurationGUID = new Hash128(rdr.ReadLine());
    28.                     LiveLinkSessionId = long.Parse(rdr.ReadLine() ?? throw new Exception("Expected line in bootstrap containing session id!"));
    29.                     World.GetOrCreateSystem<SceneSystem>().BuildConfigurationGUID = buildConfigurationGUID;
    30.                 }
    31.             }
    32.         }
    33.  
     
  14. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    annoying issue\\ 1 month and no official fix (
     
  15. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    I think updating to 0.10+ should work :)
     
    Sandaga and Nikita500 like this.
  16. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    Im on 2019.3.14 f1 but project is old/ maybe smth happening with scripts o_O or you mean downgrade to 2019. 0.10 / maybe its an idea
     
    Last edited: May 22, 2020
  17. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    677
    He meant updating the entities package to 0.10.
     
    Nikita500 and nicolasgramlich like this.
  18. Nikita500

    Nikita500

    Joined:
    Aug 18, 2015
    Posts:
    62
    that helped no errors now ty nicolasgramlich brunocoimbra / for people like me with " alternative" brain entities 0.10 is in package manager
     

    Attached Files:

    brunocoimbra and nicolasgramlich like this.