Search Unity

Question What does this unity error message mean?

Discussion in 'Code Editors & IDEs' started by MackenzieGraphics, Nov 27, 2022.

  1. MackenzieGraphics

    MackenzieGraphics

    Joined:
    Oct 20, 2022
    Posts:
    1
    I was able to troubleshoot the issues I have been having with my current script up until a certain point when I came across this error in unity:

    Script updater for Library\Bee\artifacts\1900b0aE.dag\Assembly-CSharp.dll failed to produce updates.txt file

    Now, I don't know if this is specifically my code or if it's something else but I wanted to double-check here as it occured after I had corrected several lines of my code. What exactly is the issue that is happening? And more importantly, what is the solution and how do I go about it?

    I have provided my code bellow in case it is necessary:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.AI;
    5.  
    6. public class StalkerAI : MonoBehaviour
    7. {
    8.     public GameObject stalkerdest;
    9.     public NavMeshAgent NavMeshAgent;
    10.     public GameObject stalkerEnemy;
    11.     public static bool isStalking;
    12.     public playerinventory playerinventory;
    13.  
    14.     public float startWaitTime = 4;
    15.     public float timeToRotate = 2;
    16.     public float speedWalk = 6;
    17.     public float speedRun = 9;
    18.  
    19.     public float viewRadius = 15;
    20.     public float viewAngle = 90;
    21.     public LayerMask playerMask;
    22.     public LayerMask obstacleMask;
    23.     public float meshResolution = 1f;
    24.     public int edgeIterations = 4;
    25.     public float edgeDistance = 0.5f;
    26.  
    27.     public Transform[] waypoints;
    28.     int m_CurrentWaypointIndex;
    29.  
    30.     Vector3 playerLastPosition = Vector3.zero;
    31.     Vector3 m_PlayerPosition;
    32.  
    33.     float m_WaitTime;
    34.     float m_TimeToRotate;
    35.     bool m_PlayerInRange;
    36.     bool m_PlayerNear;
    37.     bool m_IsPatrol;
    38.     bool m_CaughtPlayer;
    39.     void Start()
    40.     {
    41.         m_PlayerPosition = Vector3.zero;
    42.         m_IsPatrol = true;
    43.         m_CaughtPlayer = false;
    44.         m_PlayerInRange = false;
    45.         m_WaitTime = startWaitTime;
    46.         m_TimeToRotate = timeToRotate;
    47.  
    48.         m_CurrentWaypointIndex = 0;
    49.         NavMeshAgent = GetComponent<NavMeshAgent>();
    50.  
    51.         NavMeshAgent.isStopped = false;
    52.         NavMeshAgent.speed = speedWalk;
    53.         NavMeshAgent.SetDestination(waypoints[m_CurrentWaypointIndex].position);
    54.  
    55.     }
    56.     void Update()
    57.     {
    58.         EnviromentView();
    59.         if (!m_IsPatrol)
    60.         {
    61.             Chasing();
    62.         }
    63.         else
    64.         {
    65.             Patroling();
    66.         }
    67.      
    68.     }
    69.     private void Chasing()
    70.     {
    71.         m_PlayerNear = false;
    72.         playerLastPosition = Vector3.zero;
    73.  
    74.         if (!m_CaughtPlayer)
    75.         {
    76.             Move(speedRun);
    77.             NavMeshAgent.SetDestination(m_PlayerPosition);
    78.         }
    79.         if(NavMeshAgent.remainingDistance <= NavMeshAgent.stoppingDistance){
    80.             if(m_WaitTime <= 0 && !m_CaughtPlayer && Vector3.Distance(transform.position, GameObject.FindGameObjectWithTag("player").transform.position)>= 6f)
    81.             {
    82.                 m_IsPatrol = true;
    83.                 m_PlayerNear = false;
    84.                 Move(speedWalk);
    85.                 m_TimeToRotate = timeToRotate;
    86.                 m_WaitTime = startWaitTime;
    87.                 NavMeshAgent.SetDestination(waypoints[m_CurrentWaypointIndex].position);
    88.             }
    89.             else
    90.             {
    91.                 if(Vector3.Distance(transform.position, GameObject.FindGameObjectWithTag("player").transform.position)>= 2.5f)
    92.                 {
    93.                     Stop();
    94.                     m_WaitTime -= Time.deltaTime;
    95.                 }
    96.             }
    97.         }
    98.     }
    99.     private void Patroling()
    100.     {
    101.         if (m_PlayerNear)
    102.         {
    103.             if(m_TimeToRotate <= 0)
    104.             {
    105.                 Move(speedWalk);
    106.                 LookingPlayer(playerLastPosition);
    107.             }
    108.             else
    109.             {
    110.                 Stop();
    111.                 m_TimeToRotate -= Time.deltaTime;
    112.             }
    113.         }
    114.         else
    115.         {
    116.             m_PlayerNear = false;
    117.             playerLastPosition = Vector3.zero;
    118.             NavMeshAgent.SetDestination(waypoints[m_CurrentWaypointIndex].position);
    119.             if(NavMeshAgent.remainingDistance <= NavMeshAgent.stoppingDistance)
    120.             {
    121.                 if(m_WaitTime <=0)
    122.                 {
    123.                     NextPoint();
    124.                     Move(speedWalk);
    125.                     m_WaitTime = startWaitTime;
    126.                 }
    127.                 else
    128.                 {
    129.                     Stop();
    130.                     m_WaitTime -= Time.deltaTime;
    131.                 }
    132.             }
    133.         }
    134.     }
    135.     void Move(float speed)
    136.     {
    137.         NavMeshAgent.isStopped = false;
    138.         NavMeshAgent.speed = speed;
    139.     }
    140.     void Stop()
    141.     {
    142.         NavMeshAgent.isStopped = true;
    143.         NavMeshAgent.speed = 0;
    144.     }
    145.     public void NextPoint()
    146.     {
    147.         m_CurrentWaypointIndex = (m_CurrentWaypointIndex + 1) % waypoints.Length;
    148.         NavMeshAgent.SetDestination(waypoints[m_CurrentWaypointIndex].position);
    149.     }
    150.  
    151.     void CaughtPlayer()
    152.     {
    153.         m_CaughtPlayer = true;
    154.     }
    155.     void LookingPlayer(Vector3 player)
    156.     {
    157.         NavMeshAgent.SetDestination(player);
    158.         if(Vector3.Distance(transform.position, player)<= 0.3)
    159.         {
    160.             if(m_WaitTime <= 0)
    161.             {
    162.                 m_PlayerNear = false;
    163.                 Move(speedWalk);
    164.                 UnityEngine.AI.NavMeshAgent.setDestination(waypoints[m_CurrentWaypointIndex].position);
    165.                 m_WaitTime = startWaitTime;
    166.                 m_TimeToRotate = timeToRotate;
    167.             }
    168.             else
    169.             {
    170.                 Stop();
    171.                 m_WaitTime -= Time.deltaTime;
    172.             }
    173.         }
    174.  
    175.     }
    176.  
    177.     void EnviromentView()
    178.     {
    179.         Collider[] playerInRange = Physics.OverlapSphere(transform.position, viewRadius, playerMask);
    180.  
    181.         for (int i = 0; i < playerInRange.Length; i++)
    182.         {
    183.             Transform player = playerInRange[i].transform;
    184.             Vector3 dirToPlayer = (player.position - transform.position).normalized;
    185.             if (Vector3.Angle(transform.forward, dirToPlayer) < viewAngle / 2)
    186.             {
    187.                 float dstToPlayer = Vector3.Distance(transform.position, player.position);
    188.                 if (!Physics.Raycast(transform.position, dirToPlayer, dstToPlayer, obstacleMask))
    189.                 {
    190.                     m_PlayerInRange = true;
    191.                     m_IsPatrol = false;
    192.                 }
    193.                 else
    194.                 {
    195.                     m_PlayerInRange = false;
    196.                 }
    197.             }
    198.             if (Vector3.Distance(transform.position, player.position) > viewRadius)
    199.             {
    200.                 m_PlayerInRange = false;
    201.             }
    202.             if (m_PlayerInRange)
    203.             {
    204.                 m_PlayerPosition = player.transform.position;
    205.             }
    206.         }
    207.     }
    208.  
    209. }
    210.  
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,899
    I don't think this is a script compile error. You may want to close Unity, delete the Library folder, and after that re-open the project to see if that fixes it.
     
  3. harish_unity520

    harish_unity520

    Joined:
    Jan 25, 2023
    Posts:
    4
    I built a VR application for android and it worked fine. But when I tried to rebuild it, the build failed and it said this following error. I can't find which component is failing the build. Can I get a solution for this issue? Need fix for this. Thanks in advance!

    Error:
    Building Library\Bee\artifacts\Android\d8kzr\libil2cpp.so failed with output:
    Library/Bee/artifacts/Android/d8kzr/32df_-firstpass.o: In function `Email_SendMail_m7AF3E11545508E5F01942AE4C5514864B2D00957':
    D:/Unity Files/MetaCasinoVR/Library/Bee/artifacts/Android/il2cppOutput/cpp/Assembly-CSharp-firstpass.cpp:8728: undefined reference to `SendMail'
    Library/Bee/artifacts/Android/d8kzr/32df_-firstpass.o: In function `Email_SendMailToken_m1252CE2FD7FEC6EFD60E5576D6E3FD829D786417':
    D:/Unity Files/MetaCasinoVR/Library/Bee/artifacts/Android/il2cppOutput/cpp/Assembly-CSharp-firstpass.cpp:8785: undefined reference to `SendMailToken'
    Library/Bee/artifacts/Android/d8kzr/32df_-firstpass.o: In function `Email_SendMailTokenWithAttachment_mD936227111E3DB7A7C5D71F2F84F0EBB9D3F8752':
    D:/Unity Files/MetaCasinoVR/Library/Bee/artifacts/Android/il2cppOutput/cpp/Assembly-CSharp-firstpass.cpp:8838: undefined reference to `SendMailTokenWithAttachment'
    clang++: error: linker command failed with exit code 1 (use -v to see invocation)

    BuildFailedException: Incremental Player build failed!
    UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <62de111f18d242d586f9a078a33b1ba2>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    Build completed with a result of 'Failed' in 90 seconds (89584 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <11d97693183d4a6bb35c29ae7882c66b>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <11d97693183d4a6bb35c29ae7882c66b>:0
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    image_2023-09-15_155718450.png image_2023-09-15_155840798.png
     
  4. harish_unity520

    harish_unity520

    Joined:
    Jan 25, 2023
    Posts:
    4
    @Tomas1856 Can you please guide me with a solution! I'm unable to find what is causing the error!
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    You're trying to call SendMail function on Android, but don't provide the implementation, either don't call that function by ifdefing'out the code, for #if !UNITY_ANDROID... #endif

    or provide SendMail implementation
     
  6. harish_unity520

    harish_unity520

    Joined:
    Jan 25, 2023
    Posts:
    4
    Thanks for the help! It helped me build the application. Hope it runs perfectly.