Search Unity

Android build errors

Discussion in 'Scripting' started by Cristian_Triscu, Aug 1, 2019.

  1. Cristian_Triscu

    Cristian_Triscu

    Joined:
    Jun 22, 2019
    Posts:
    1
    Hello, I have this problem when i hit build on the android
    1) Library\PackageCache\com.unity.textmeshpro@2.0.1\Scripts\Runtime\TMP_UpdateManager.cs(134,43): error CS0246: The type or namespace name 'ScriptableRenderContext' could not be found (are you missing a using directive or an assembly reference?)

    2) C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.timeline\Runtime\Animation\AnimationOutputWeightProcessor.cs(21,16): error CS0122: 'AnimationMotionXToDeltaPlayable' is inaccessible due to its protection level

    3)C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.timeline\Runtime\Events\Signals\SignalAsset.cs(11,6): error CS0122: 'AssetFileNameExtensionAttribute' is inaccessible due to its protection level

    Help please!

    Code for the first one (cs0246):
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections.Generic;
    4.  
    5. #if UNITY_2019_1_OR_NEWER
    6. using UnityEngine.Rendering;
    7. #elif UNITY_2018_1_OR_NEWER
    8. using UnityEngine.Experimental.Rendering;
    9. #endif
    10.  
    11.  
    12. namespace TMPro
    13. {
    14.  
    15.     public class TMP_UpdateManager
    16.     {
    17.         private static TMP_UpdateManager s_Instance;
    18.  
    19.         private readonly List<TMP_Text> m_LayoutRebuildQueue = new List<TMP_Text>();
    20.         private Dictionary<int, int> m_LayoutQueueLookup = new Dictionary<int, int>();
    21.  
    22.         private readonly List<TMP_Text> m_GraphicRebuildQueue = new List<TMP_Text>();
    23.         private Dictionary<int, int> m_GraphicQueueLookup = new Dictionary<int, int>();
    24.  
    25.         private readonly List<TMP_Text> m_InternalUpdateQueue = new List<TMP_Text>();
    26.         private Dictionary<int, int> m_InternalUpdateLookup = new Dictionary<int, int>();
    27.  
    28.         //private bool m_PerformingGraphicRebuild;
    29.         //private bool m_PerformingLayoutRebuild;
    30.  
    31.         /// <summary>
    32.         /// Get a singleton instance of the registry
    33.         /// </summary>
    34.         public static TMP_UpdateManager instance
    35.         {
    36.             get
    37.             {
    38.                 if (TMP_UpdateManager.s_Instance == null)
    39.                     TMP_UpdateManager.s_Instance = new TMP_UpdateManager();
    40.                 return TMP_UpdateManager.s_Instance;
    41.             }
    42.         }
    43.  
    44.  
    45.         /// <summary>
    46.         /// Register to receive rendering callbacks.
    47.         /// </summary>
    48.         protected TMP_UpdateManager()
    49.         {
    50.             Camera.onPreCull += OnCameraPreCull;
    51.  
    52.             #if UNITY_2019_1_OR_NEWER
    53.                 RenderPipelineManager.beginFrameRendering += OnBeginFrameRendering;
    54.             #elif UNITY_2018_1_OR_NEWER
    55.                 RenderPipeline.beginFrameRendering += OnBeginFrameRendering;
    56.             #endif
    57.         }
    58.  
    59.        
    60.         /// <summary>
    61.         /// Function used as a replacement for LateUpdate() to handle SDF Scale updates and Legacy Animation updates.
    62.         /// </summary>
    63.         /// <param name="textObject"></param>
    64.         internal static void RegisterTextObjectForUpdate(TMP_Text textObject)
    65.         {
    66.             TMP_UpdateManager.instance.InternalRegisterTextObjectForUpdate(textObject);
    67.         }
    68.  
    69.         private void InternalRegisterTextObjectForUpdate(TMP_Text textObject)
    70.         {
    71.             int id = textObject.GetInstanceID();
    72.  
    73.             if (this.m_InternalUpdateLookup.ContainsKey(id))
    74.                 return;
    75.  
    76.             m_InternalUpdateLookup[id] = id;
    77.             this.m_InternalUpdateQueue.Add(textObject);
    78.  
    79.             return;
    80.         }
    81.  
    82.  
    83.         /// <summary>
    84.         /// Function to register elements which require a layout rebuild.
    85.         /// </summary>
    86.         /// <param name="element"></param>
    87.         public static void RegisterTextElementForLayoutRebuild(TMP_Text element)
    88.         {
    89.             TMP_UpdateManager.instance.InternalRegisterTextElementForLayoutRebuild(element);
    90.         }
    91.  
    92.         private bool InternalRegisterTextElementForLayoutRebuild(TMP_Text element)
    93.         {
    94.             int id = element.GetInstanceID();
    95.  
    96.             if (this.m_LayoutQueueLookup.ContainsKey(id))
    97.                 return false;
    98.  
    99.             m_LayoutQueueLookup[id] = id;
    100.             this.m_LayoutRebuildQueue.Add(element);
    101.  
    102.             return true;
    103.         }
    104.  
    105.  
    106.         /// <summary>
    107.         /// Function to register elements which require a layout rebuild.
    108.         /// </summary>
    109.         /// <param name="element"></param>
    110.         public static void RegisterTextElementForGraphicRebuild(TMP_Text element)
    111.         {
    112.             TMP_UpdateManager.instance.InternalRegisterTextElementForGraphicRebuild(element);
    113.         }
    114.  
    115.         private bool InternalRegisterTextElementForGraphicRebuild(TMP_Text element)
    116.         {
    117.             int id = element.GetInstanceID();
    118.  
    119.             if (this.m_GraphicQueueLookup.ContainsKey(id))
    120.                 return false;
    121.  
    122.             m_GraphicQueueLookup[id] = id;
    123.             this.m_GraphicRebuildQueue.Add(element);
    124.  
    125.             return true;
    126.         }
    127.  
    128.  
    129.         /// <summary>
    130.         /// Callback which occurs just before the Scriptable Render Pipeline (SRP) begins rendering.
    131.         /// </summary>
    132.         /// <param name="cameras"></param>
    133.         #if UNITY_2019_1_OR_NEWER
    134.         public void OnBeginFrameRendering(ScriptableRenderContext renderContext, Camera[] cameras)
    135.         #elif UNITY_2018_1_OR_NEWER
    136.         void OnBeginFrameRendering(Camera[] cameras)
    137.         #endif
    138.         {
    139.             // Exclude the PreRenderCamera
    140.             #if UNITY_EDITOR
    141.             if (cameras.Length == 1 && cameras[0].cameraType == CameraType.Preview)
    142.                 return;
    143.             #endif
    144.             DoRebuilds();
    145.         }
    146.  
    147.         /// <summary>
    148.         /// Callback which occurs just before the cam is rendered.
    149.         /// </summary>
    150.         /// <param name="cam"></param>
    151.         void OnCameraPreCull(Camera cam)
    152.         {
    153.             // Exclude the PreRenderCamera
    154.             #if UNITY_EDITOR
    155.             if (cam.cameraType == CameraType.Preview)
    156.                 return;
    157.             #endif
    158.             DoRebuilds();
    159.         }
    160.        
    161.         /// <summary>
    162.         /// Process the rebuild requests in the rebuild queues.
    163.         /// </summary>
    164.         void DoRebuilds()
    165.         {
    166.             // Handle text objects the require an update either as a result of scale changes or legacy animation.
    167.             for (int i = 0; i < m_InternalUpdateQueue.Count; i++)
    168.             {
    169.                 m_InternalUpdateQueue[i].InternalUpdate();
    170.             }
    171.  
    172.             // Handle Layout Rebuild Phase
    173.             for (int i = 0; i < m_LayoutRebuildQueue.Count; i++)
    174.             {
    175.                 m_LayoutRebuildQueue[i].Rebuild(CanvasUpdate.Prelayout);
    176.             }
    177.  
    178.             if (m_LayoutRebuildQueue.Count > 0)
    179.             {
    180.                 m_LayoutRebuildQueue.Clear();
    181.                 m_LayoutQueueLookup.Clear();
    182.             }
    183.  
    184.             // Handle Graphic Rebuild Phase
    185.             for (int i = 0; i < m_GraphicRebuildQueue.Count; i++)
    186.             {
    187.                 m_GraphicRebuildQueue[i].Rebuild(CanvasUpdate.PreRender);
    188.             }
    189.  
    190.             // If there are no objects in the queue, we don't need to clear the lists again.
    191.             if (m_GraphicRebuildQueue.Count > 0)
    192.             {
    193.                 m_GraphicRebuildQueue.Clear();
    194.                 m_GraphicQueueLookup.Clear();
    195.             }
    196.         }
    197.  
    198.         internal static void UnRegisterTextObjectForUpdate(TMP_Text textObject)
    199.         {
    200.             TMP_UpdateManager.instance.InternalUnRegisterTextObjectForUpdate(textObject);
    201.         }
    202.  
    203.         /// <summary>
    204.         /// Function to unregister elements which no longer require a rebuild.
    205.         /// </summary>
    206.         /// <param name="element"></param>
    207.         public static void UnRegisterTextElementForRebuild(TMP_Text element)
    208.         {
    209.             TMP_UpdateManager.instance.InternalUnRegisterTextElementForGraphicRebuild(element);
    210.             TMP_UpdateManager.instance.InternalUnRegisterTextElementForLayoutRebuild(element);
    211.             TMP_UpdateManager.instance.InternalUnRegisterTextObjectForUpdate(element);
    212.         }
    213.  
    214.         private void InternalUnRegisterTextElementForGraphicRebuild(TMP_Text element)
    215.         {
    216.             int id = element.GetInstanceID();
    217.  
    218.             TMP_UpdateManager.instance.m_GraphicRebuildQueue.Remove(element);
    219.             m_GraphicQueueLookup.Remove(id);
    220.         }
    221.  
    222.         private void InternalUnRegisterTextElementForLayoutRebuild(TMP_Text element)
    223.         {
    224.             int id = element.GetInstanceID();
    225.  
    226.             TMP_UpdateManager.instance.m_LayoutRebuildQueue.Remove(element);
    227.             m_LayoutQueueLookup.Remove(id);
    228.         }
    229.  
    230.         private void InternalUnRegisterTextObjectForUpdate(TMP_Text textObject)
    231.         {
    232.             int id = textObject.GetInstanceID();
    233.  
    234.             TMP_UpdateManager.instance.m_InternalUpdateQueue.Remove(textObject);
    235.             m_InternalUpdateLookup.Remove(id);
    236.         }
    237.     }
    238. }

    code for the 2: (3 is kind of the same i think)
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using UnityEngine.Animations;
    3. using UnityEngine.Playables;
    4.  
    5. namespace UnityEngine.Timeline
    6. {
    7.     // Does a post processing of the weights on an animation track to properly normalize
    8.     // the mixer weights so that blending does not bring default poses and subtracks, layers and
    9.     // layer graphs blend correctly
    10.     class AnimationOutputWeightProcessor : ITimelineEvaluateCallback
    11.     {
    12.         struct WeightInfo
    13.         {
    14.             public Playable mixer;
    15.             public Playable parentMixer;
    16.             public int port;
    17.             public bool modulate;
    18.         }
    19.  
    20.         public AnimationPlayableOutput m_Output;
    21.         public AnimationMotionXToDeltaPlayable m_MotionXPlayable;
    22.         public AnimationMixerPlayable m_PoseMixer;
    23.         public AnimationLayerMixerPlayable m_LayerMixer;
    24.         readonly List<WeightInfo> m_Mixers = new List<WeightInfo>();
    25.  
    26.         public AnimationOutputWeightProcessor(AnimationPlayableOutput output)
    27.         {
    28.             m_Output = output;
    29.             output.SetWeight(0);
    30.             FindMixers();
    31.         }
    32.  
    33.         static Playable FindFirstAnimationPlayable(Playable p)
    34.         {
    35.             var currentNode = p;
    36.             while (currentNode.IsValid() && currentNode.GetInputCount() > 0
    37.                    && !currentNode.IsPlayableOfType<AnimationLayerMixerPlayable>()
    38.                    && !currentNode.IsPlayableOfType<AnimationMotionXToDeltaPlayable>()
    39.                    && !currentNode.IsPlayableOfType<AnimationMixerPlayable>())
    40.                 currentNode = currentNode.GetInput(0);
    41.  
    42.             return currentNode;
    43.         }
    44.  
    45.         void FindMixers()
    46.         {
    47.             m_Mixers.Clear();
    48.             m_PoseMixer = AnimationMixerPlayable.Null;
    49.             m_LayerMixer = AnimationLayerMixerPlayable.Null;
    50.             m_MotionXPlayable = AnimationMotionXToDeltaPlayable.Null;
    51.  
    52.             var playable = m_Output.GetSourcePlayable();
    53.             var outputPort = m_Output.GetSourceOutputPort();
    54.             if (!playable.IsValid() || outputPort < 0 || outputPort >= playable.GetInputCount())
    55.                 return;
    56.  
    57.             var mixer = FindFirstAnimationPlayable(playable.GetInput(outputPort));
    58.  
    59.             Playable motionXPlayable = mixer;
    60.             if (motionXPlayable.IsPlayableOfType<AnimationMotionXToDeltaPlayable>())
    61.             {
    62.                 m_MotionXPlayable = (AnimationMotionXToDeltaPlayable)motionXPlayable;
    63.                 mixer = m_MotionXPlayable.GetInput(0);
    64.             }
    65.  
    66.             if (mixer.IsValid() && mixer.IsPlayableOfType<AnimationMixerPlayable>())
    67.             {
    68.                 m_PoseMixer = (AnimationMixerPlayable)mixer;
    69.                 Playable layerMixer = m_PoseMixer.GetInput(0);
    70.  
    71.                 if (layerMixer.IsValid() && layerMixer.IsPlayableOfType<AnimationLayerMixerPlayable>())
    72.                     m_LayerMixer = (AnimationLayerMixerPlayable)layerMixer;
    73.             }
    74.             else if (mixer.IsValid() && mixer.IsPlayableOfType<AnimationLayerMixerPlayable>())
    75.             {
    76.                 m_LayerMixer = (AnimationLayerMixerPlayable)mixer;
    77.             }
    78.  
    79.  
    80.             if (!m_LayerMixer.IsValid())
    81.                 return;
    82.  
    83.             var count = m_LayerMixer.GetInputCount();
    84.             for (var i = 0; i < count; i++)
    85.             {
    86.                 FindMixers(m_LayerMixer, i, m_LayerMixer.GetInput(i));
    87.             }
    88.         }
    89.  
    90.         // Recursively accumulates mixers.
    91.         void FindMixers(Playable parent, int port, Playable node)
    92.         {
    93.             if (!node.IsValid())
    94.                 return;
    95.  
    96.             var type = node.GetPlayableType();
    97.             if (type == typeof(AnimationMixerPlayable) || type == typeof(AnimationLayerMixerPlayable))
    98.             {
    99.                 // use post fix traversal so children come before parents
    100.                 int subCount = node.GetInputCount();
    101.                 for (int j = 0; j < subCount; j++)
    102.                 {
    103.                     FindMixers(node, j, node.GetInput(j));
    104.                 }
    105.  
    106.                 // if we encounter a layer mixer, we assume there is nesting occuring
    107.                 //  and we modulate the weight instead of overwriting it.
    108.                 var weightInfo = new WeightInfo
    109.                 {
    110.                     parentMixer = parent,
    111.                     mixer = node,
    112.                     port = port,
    113.                     modulate = (type == typeof(AnimationLayerMixerPlayable))
    114.                 };
    115.                 m_Mixers.Add(weightInfo);
    116.             }
    117.             else
    118.             {
    119.                 var count = node.GetInputCount();
    120.                 for (var i = 0; i < count; i++)
    121.                 {
    122.                     FindMixers(parent, port, node.GetInput(i));
    123.                 }
    124.             }
    125.         }
    126.  
    127.         public void Evaluate()
    128.         {
    129.             m_Output.SetWeight(1);
    130.             for (int i = 0; i < m_Mixers.Count; i++)
    131.             {
    132.                 var mixInfo = m_Mixers[i];
    133.                 float weight = mixInfo.modulate ? mixInfo.parentMixer.GetInputWeight(mixInfo.port) : 1.0f;
    134.                 mixInfo.parentMixer.SetInputWeight(mixInfo.port, weight * WeightUtility.NormalizeMixer(mixInfo.mixer));
    135.             }
    136.  
    137.             float normalizedWeight = WeightUtility.NormalizeMixer(m_LayerMixer);
    138.  
    139.             var animator = m_Output.GetTarget();
    140.             if (animator == null)
    141.                 return;
    142.  
    143.             // AnimationMotionXToDeltaPlayable must blend with default values when previewing tracks with absolute root motion.
    144.             bool blendMotionX = !Application.isPlaying && m_MotionXPlayable.IsValid() && m_MotionXPlayable.IsAbsoluteMotion();
    145.  
    146.             if (blendMotionX)
    147.             {
    148.                 m_PoseMixer.SetInputWeight(0, normalizedWeight);
    149.                 m_PoseMixer.SetInputWeight(1, 1.0f - normalizedWeight);
    150.             }
    151.             else
    152.             {
    153.                 if (!m_PoseMixer.Equals(AnimationMixerPlayable.Null))
    154.                 {
    155.                     m_PoseMixer.SetInputWeight(0, 1.0f);
    156.                     m_PoseMixer.SetInputWeight(1, 0.0f);
    157.                 }
    158.  
    159.                 m_Output.SetWeight(normalizedWeight);
    160.             }
    161.         }
    162.     }
    163. }
    164.  
     
  2. PanicEnsues

    PanicEnsues

    Joined:
    Jul 17, 2014
    Posts:
    187
    Are you actually using TextMesh Pro and Timeline? If not, I would suggest going to Package Manager and removing those packages (if Timeline is a package, I don't recall off-hand).

    Not exactly a solution to the problem, but a way to avoid it. :)