Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

API Updater not explicit at all

Discussion in 'Editor & General Support' started by Mikilo, Aug 13, 2017.

  1. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    Hi everybody,

    I have a simple question:

    Is there a way to know what the API Updater has updated?

    My scenario is simple, I am Asset Store developer, I do scripting.

    Whenever I copy my files to test on Unity 2017.1.0f3, I receive no warning or error.

    But if I compile my files into a library and copy the result in Unity 2017.1.0f3, API Updater is triggered.

    Assembly: 'C:/Unity/Test/Assets/Plugins/TestLibrary.dll' uses obsolete Unity API (UnityUpgradable)

    I checked the logs but no interesting data is given.

    To isolate the guilty code, I would have to remove code and retry, but my libraries are bigger than 100kB and have dependencies.
    It will take a very long day or many days to narrow it down for all my libraries.

    Thank you people!

    Edit:
    Test 1:
    I tried to build, to force Unity to tell me more data, nothing happened.

    Test 2:
    I manually copied the DLL into the project, in this case, Unity does not trigger the API Updater.
    API Updater is only triggered when I import it via a package.


    Test 3:
    I ran this script:
    "C:\Program Files\Unity 2017.1.0f3\Editor\Data\MonoBleedingEdge\bin\mono.exe" -v "C:/Program Files/Unity 2017.1.0f3/Editor/Data/Tools/ScriptUpdater/AssemblyUpdater.exe" --timestamp 636382412760996084 --api-version 2017.1.0f3 --check-update-required -a C:/Users/mikil/Documents/Unity/TestUA/Assets/Plugins/NGTools/Editor/NGRemoteSceneEditor.dll -s "C:\Program Files\Unity 2017.1.0f3\Editor\Data\Managed,+C:/Program Files/Unity 2017.1.0f3/Editor/Data\UnityExtensions/Unity,+C:/Users/mikil/Documents/Unity/TestUA/Assets" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Advertisements\UnityEngine.Advertisements.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Advertisements\Editor/UnityEditor.Advertisements.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\GUISystem\UnityEngine.UI.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\GUISystem\Standalone/UnityEngine.UI.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\GUISystem\Editor/UnityEditor.UI.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Networking\UnityEngine.Networking.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Networking\Standalone/UnityEngine.Networking.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Networking\Editor/UnityEditor.Networking.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\TestRunner\Editor/UnityEditor.TestRunner.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\TestRunner\UnityEngine.TestRunner.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\TestRunner\net35/unity-custom/nunit.framework.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\TestRunner\portable/nunit.framework.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Timeline\RuntimeEditor/UnityEngine.Timeline.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Timeline\Runtime/UnityEngine.Timeline.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\Timeline\Editor/UnityEditor.Timeline.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\TreeEditor\Editor/UnityEditor.TreeEditor.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityAnalytics\UnityEngine.Analytics.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityAnalytics\Editor/UnityEditor.Analytics.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityHoloLens\Editor/UnityEditor.HoloLens.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityHoloLens\Runtime/UnityEngine.HoloLens.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityHoloLens\RuntimeEditor/UnityEngine.HoloLens.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityPurchasing\UnityEngine.Purchasing.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityPurchasing\Editor/UnityEditor.Purchasing.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\UnityExtensions\Unity\UnityVR\Editor/UnityEditor.VR.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\Managed\UnityEngine.dll" "C:\Program Files\Unity 2017.1.0f3\Editor\Data\Managed\UnityEditor.dll" > result.txt
    pause

    To simplify, it runs API Updater on NGRemoteSceneEditor.dll.

    The few first lines of result.txt:
    converting method void System.OutOfMemoryException:.ctor (string)
    Method void System.OutOfMemoryException:.ctor (string) emitted at 00690D78 to 00690DA6 (code length 46) [AssemblyUpdater.exe] with opts peephole,branch,inline,cfold,consprop,copyprop,deadce,linears,cmov,intrins,loop,fcmov,aot,exception,gshared,simd,unsafe,float32

    It is converting OutOfMemoryException's constructor... And the remaining lines are code not from my library.
    At this point, I don't even know if I can solve this API Updater.
     
    Last edited: Aug 13, 2017
  2. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi

    Unfortunately there's no easy way to figure out why the updater thinks something should be updated.

    Improving the updater logging is certainly in our backlog but we don't have a time frame.

    The behavior you described, i.e, compiling your source inside Editor or even importing the assembly not triggering the updater, is not expected.

    Are you sure you haven't allowed the updater to run before importing the assembly or your source code? (in this case you'd not be asked again if you did not restart the editor or open another project)

    If you ware willing to I'll send you a version of the updater with more logging (probably on next Monday)

    Best

    Adriano
     
    Mikilo likes this.
  3. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    Thanks for the answer, would be interesting yeah!
     
  4. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    We experienced the same exact issue and @Vagaus was very helpful in tracking down the source of the problem.

    For us, this experience was triggered by a change in the Unity API that converted a "member method" into an "extension method." The key here is that such an API change would result in no script adjustments; it's invisible to everyone except the compiler. When the code is compiled, however, the IL that is produced and stored in an assembly is going to be different because the same script is resolved to a different function/method. This is [probably] the reason that you're seeing the API Updater trigger for the assembly but not the script.

    In our case the culprit was the WWW.GetAudioClip method. In Unity 5.6 this was converted into the WWWAudioExtensions.GetAudioClip extension method. Everything worked great in script, but our assemblies would [correctly] trigger the API Updater (which would properly handle the conversion).

    While @Vagaus works on the adjusted updater executable, I'd suggest looking over the API History for 2017.1* and see if you can find any *Extension classes in the list that look suspicious. A quick "find" for "extension" on that page shows the following interesting classes:
    I hope this is helpful!

    [* I have found that this list is not 100% comprehensive, but it is a good place to start...]
     
    AdrianoVerona_Unity and Mikilo like this.
  5. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    @Mikilo @SonicBloomEric You can download a version of the updater with more logging enabled here https://drive.google.com/open?id=0B7GZ512tQYxkMGhmM0FjU1FDQms

    You will need to set the log level to Info or Debug through UNITY_ASSEMBLYUPDATE_LOGTHRESHOLD environment variable.

    You can either replace the folder Editor/Data/Tools/ScriptUpdater with the contents of the zip file (of course, back up your installation before doing that) or extract the zip file somewhere and run the updater in the command line (if you feel adventurous) (easiest way to do that is to force the udpater to run - inside the editor - which will log the command line arguments used in the Editor.log and then running this new version of the updater with the same set of parameters)

    BTW, these changes will be incorporated in the shipped version in the near future.

    Best
     
    Mikilo likes this.
  6. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    I knew you were the man :)

    Thank for the update, I will give it a try later.
     
    AdrianoVerona_Unity likes this.
  7. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    @Mikilo @SonicBloomEric Have you had the chance to try it out ?

    I am looking forward to hear your feedback

    Best

    Adriano
     
    Mikilo likes this.
  8. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    Hey Vagaus!

    Here is your first report:

    Code (CSharp):
    1. [AssemblyUpdater] Time to start updater: 130 ms
    2. [AssemblyUpdater] Time to check for API compatibility attribute: 26 ms
    3.  
    4. System.MissingMethodException: Method 'APIUpdater.Framework.Util.CecilExtensions.SymbolReaderProviderFor' not found.
    5.   at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, APIUpdater.Framework.Configuration.IConfigurationProvider configuration, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x0002b] in <fc8204afd8f44ddfb3725526ef3671e2>:0
    6.   at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x00001] in <fc8204afd8f44ddfb3725526ef3671e2>:0
    7.   at AssemblyUpdater.Application.Program.CheckForObsoleteAPIUsage (AssemblyUpdater.Application.CommandLineSpec config) [0x00013] in <fc8204afd8f44ddfb3725526ef3671e2>:0
    8.   at AssemblyUpdater.Application.Program.Main (System.String[] args) [0x00057] in <fc8204afd8f44ddfb3725526ef3671e2>:0
    9. UnityEditor.Scripting.APIUpdaterHelper:DoesAssemblyRequireUpgrade(String)
    In my case, I have a dozen DLLs, I reduced it to only 3 DLLs for the test.
    Here are my steps:
    1/ UNITY_ASSEMBLYUPDATE_LOGTHRESHOLD to "Debug"
    2/ Replaced ScriptUpdater folder with your files.
    3/ Launched empty project with Unity 2017.1.0f3.
    4/ Imported a package containing 3 DLLs generated with Unity 5.4.0f3.

    I think the exception above is aborting the whole process of updating the DLL.

    I joined the ScriptUpdater output in this post.
    If you want me to call ScriptUpdater.exe directly from the CLI, let me know.
     

    Attached Files:

  9. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    @Mikilo Thanks for the feedback

    This is weird. This error means that the updater is using a method that is not present in the assemblies.. which is pretty odd.

    Can you create a simple project that reproduces the issue? If so, can you zip it and send me?

    I'll try to reproduce locally.
     
  10. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    The strange things is, in your Zip, you have no AssemblyUpdater.exe, is that normal?

    I'll prepare you a zip.
     
  11. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    Here is my project and stuff needed.

    My ScriptUpdater folder: (4MB was too big apparently to be uploaded via this form)
    https://ufile.io/9hq2e
     

    Attached Files:

  12. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Definitely no :(

    I messed up.

    I'll prepare another zip with the correct content, sorry

    Adriano
     
    Mikilo likes this.
  13. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi @Mikilo

    I've just updated the ZIP contents. Can you give it another try and let me know the outcome?

    Thanks

    Adriano
     
  14. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    Hi @Vagaus

    I retried with your sample.
    Unfortunately, I noticed no changes. Maybe you know where to look at.

    Same configuration:
    Unity 2017.1.0f3
    Import package containing 3 DLLs generated with Unity 5.4.0f3.
    UNITY_ASSEMBLYUPDATE_LOGTHRESHOLD still set with "Debug".

    Unity's console is showing this:
    (Each "-------------------------------------------" is to separate logs)

    Assembly: 'C:/Users/mikil/Documents/Unity/NGTools/NGTools 2017.1.0f3/Assets/Plugins/NGTools/NGCore/Editor/NGCoreEditor.dll' uses obsolete Unity API (UnityUpgradable)
    -------------------------------------------
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'UnityEngine.Texture2D.LoadImage'.
    at NGToolsEditor.Language_english..ctor () [0x00000] in <filename unknown>:0
    at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&)
    at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00119] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:513
    --- End of inner exception stack trace ---
    at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0012c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519
    at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528
    at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x001b8] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:338
    at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:268
    at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:263
    at NGToolsEditor.Utility.CreateAllInstancesOf[EmbedLocale] (System.Object[] args) [0x00000] in <filename unknown>:0
    at NGToolsEditor.Localization..cctor () [0x00000] in <filename unknown>:0
    UnityEditor.EditorAssemblies:processInitializeOnLoadAttributes()
    -------------------------------------------
    Finished updating scripts / assemblies
    -------------------------------------------
    MissingMethodException: Method not found: 'UnityEngine.Texture2D.LoadImage'.
    UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:118)


    You will find the full log attached to this post.



    I also tried to run the command manually, I add the argument "-v" in the command.
    You will find the result attached as well. (result.txt)
     

    Attached Files:

  15. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi

    Can you share this package with me? So I can look into it.

    Best

    Adriano
     
  16. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    It is this one. I uploaded it in the post above.
     

    Attached Files:

  17. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    @Mikilo What are your .NET API settings? Are you using 4.6 or the default settings?

    @Vagaus Sorry for the radio silence - I didn't get any notifications of posts here! I will update the forum settings so that I get emails. I'll try to find some time this week to give the build a shot.
     
  18. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    SonicBloomEric likes this.
  19. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    I am not sure what is going on on your side :(

    Attached you can see the output of the AssemblyUpdater with the latest version I've pushed to Google Drive, which means it runs and does log the updates. (notice that the log only happens when we update the assembly, which not happens if you pass --check-update-required argument to AssemblyUpdater)

    Can you share more details?

    - Full command line used
    - OS
    - Version of .NET / Mono

    Adriano
     

    Attached Files:

  20. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    No problems at all ;)

    Thanks for helping improve the updater

    Best

    Adriano
     
    SonicBloomEric likes this.
  21. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    Wow that's absolutely not the output I have.

    I will launch your command instead of mine, because I use mono.exe with arguments instead of directly AssemblyUpdater.

    Should Unity output the same as yours?
    Because if it is the case, I don't have it, even with UNITY_ASSEMBLYUPDATE_LOGTHRESHOLD to "Debug". Maybe I should try with "Info" like you.
     
  22. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    My command:

    Here is the result I get when called from CMD:
    When it is done through Unity, I don't have any, certainly because of the argument "--check-update-required"
    inserted.



    I also tried adding "--check-update-required" to my command:
    With Info as debug level:
    With Debug as debug level:
    I don't know if these can help you more.
     
  23. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    Did you run Unity from the command line? You would need to set the UNITY_ASSEMBLYUPDATE_LOGTHRESHOLD environment variable as @Vagaus explained and then from the same command line, navigate to the Unity executable and start it from there (rather than through a mouse click).

    In Windows, at least, I believe you can also set what environment variables are added to an application when started through it's .exe or a shortcut to it...?
     
    Mikilo likes this.
  24. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    No I don't, I use the exe.

    UNITY_ASSEMBLYUPDATE_LOGTHRESHOLD is set to Debug in the environment variable already, no need to set anything.
     
  25. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    I understand that you don't use the exe. But this is one of the things that we were asked to check. Given that your approach is seeing difficulties, you could try to use Unity directly. As I understand it, you would need to replace the folder that @Vagaus outlined here and then start Unity through the command line with the environment variable set or through a properly configured Shortcut. Then you would check the Editor.log for the output.
     
  26. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    I think you misread what I wrote.

    I do use Unity directly. :)

    Here is the proof that my environment is good:

    I use this code:
    Code (CSharp):
    1. public class Test
    2. {
    3.     [UnityEditor.MenuItem("Window/Test")]
    4.     private static void    Start()
    5.     {
    6.        foreach (System.Collections.DictionaryEntry de in System.Environment.GetEnvironmentVariables())
    7.            UnityEngine.Debug.LogFormat("{0} = {1}", de.Key, de.Value);
    8.     }
    9. }
    And one of the result is:

     
  27. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    I do believe I did read you incorrectly! Sorry about that! Huh...
     
  28. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    That is what I expect :)

    Actually you should get the same content in Editor.log but only after accepting to apply the update (i.e, if you dismiss the APIUpdater dialog pressing "no thanks" then you'll not see the log since the assembly will not be updated)

    Best

    Adriano
     

    Attached Files:

  29. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    You too misread what I wrote.

    "When it is done through Unity", the assembly is updated.

    But I double-checked.

    And yeah, I missed something. Unity updates twice the same assembly.
    First time, it works good, I got all of your debug information.
    On the second retry, since the assembly is already updated, the output is very small.

    I checked only the latter, didn't expect to see it doubled.

    But it's working. :)
     
  30. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    @Vagaus I just ran the new Script Updater in Unity 2017.1. Some notes:
    • I did not receive the normal API Updater confirmation pop-up as expected. Does it perhaps perform the update automatically now?
    • In the Editor.log I did not see any of the reporting text that you outlined. I did notice that the updater reports the steps that it takes. I didn't see one for Extension Methods... what step should content for that appear in? For the record, here are the steps I see each time a DLL is checked:
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.MoveToNamespace
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.MemberReferenceReplacer
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.MethodRetargeter
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.ReplacePropertyGetWithGenericMethod
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.StringBasedMethodReplacer
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.TypeReferenceUpdater
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.MemberReferenceRemover
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.ImplicitlyConvertibleMemberTypeChange
      • [AssemblyUpdater] Applying step AssemblyUpdater.Steps.MethodSignatureChanger
    Is there something I'm missing here?
     
  31. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    Were you able to identify the problematic API? Which was it?
     
  32. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    The only case where I was able to trigger the popup was by importing a package with the DLL.

    Here is what I can extract from my logs with debug set:
    In fact, there was no problem, it was just lacking of output, we didn't know what was updated.
    Now I can see that LoadImage has been updated.
     
  33. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    Awesome. This confirms a few things:
    1. The issue you faced was the same that I did: Unity changed a class instance method to an Extension Method.
    2. Extension Methods are updated in the "Applying step AssemblyUpdater.Steps.MethodSignatureChanger" phase.
    I'll take another stab at running this on my end as well. Nice!
     
    Mikilo likes this.
  34. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    @Vagaus I am not sure exactly what's happening but the ScriptUpdater folder that you posted does not work for me. I just did an A/B comparison between the original and the one you provided and here is what I see:
    • Original: API Updater Dialog appears as normal.
    • New: No API Updater Dialog appears, regardless of whether I've set the environment variable or not. The process simply completes without issue. I assume that this is automatically fixing the issues in the DLLs. Either that or it's simply not recognizing the issue, which could arguably be worse(?).
    If it helps, I am testing on macOS.
     
  35. Mikilo

    Mikilo

    Joined:
    Jan 29, 2013
    Posts:
    488
    @SonicBloomEric Note that if the DLL is already updated, you won't have any signal. It needs to be outdated in the first place.
     
  36. SonicBloomEric

    SonicBloomEric

    Joined:
    Sep 11, 2014
    Posts:
    645
    Yup! Well aware of that. I clean out the project and install from a fresh Unity Package each time I run the test.
     
    Mikilo likes this.
  37. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Sorry for the delay (had a couple of holidays and then a fire to put of - still working on that)

    The only difference in this modified updater version is the logging. Everything else should work as before.

    Hm.. it may be the case that there's some difference (caused by the compiler) but I doubt that

    I'll check on OSx ASAP

    Adriano
     
    Last edited: Sep 19, 2017
    SonicBloomEric likes this.
  38. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,183
    @AdrianoVerona_Unity I did the steps you mentioned with the logging, and it actually helped me find a few script issues, which I fixed, but then it printed this and I couldn't tell what it means. Do you know?

    EDIT: It looks like it might be in a DLL. Is there a way to set settings for the APIUpdater to tell it to ignore DLLs?

     

    Attached Files:

    Last edited: Mar 30, 2018
  39. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi @Ben-BearFish

    This is a crash in the ScriptUpdater process while it was trying to check whether a member reference should be removed from your sources.

    Can you share your editor.log? (better would be to either reproduce it with a minimal project or remove all non script related assets from your project, zip it and sent it to me so I can debug)

    Best

    Adriano
     
  40. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    185
    Hi @AdrianoVerona_Unity,

    I'm getting the same error as Ben-BearFish with Unity 2018.2.7f1 (and some other 2018 versions I tried).
    Attached is the editor.log file.
     

    Attached Files:

  41. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Is this reproducible? If so, can you file an issue and post the issue # here ?

    Thanks

    Best

    Adriano
     
    Last edited: Sep 14, 2018
  42. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    185
    Yes, 100% reproducible. I've submitted it as #1081267.

    I forgot to mention it in that bug report, but it's somehow related to the scripts in the Editor/ImageEffects folder of the reproduction project.
    If that folder is removed the API Updater is successful.
     
    AdrianoVerona_Unity likes this.
  43. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Thanks. We'll investigate it.

    Best

    Adriano
     
  44. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi @Sebioff

    I've found/fixed the issue. Fix will most likely land in 2018.3

    Best

    Adriano
     
  45. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    185
    Great, thank you!
     
  46. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,183
    Could I ask what the bug was?
     
  47. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    SonicBloomEric likes this.
  48. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,183
    @AdrianoVerona_Unity Do you know if this was fixed? In 2018.3 the API Updater still fails.

    Also, is there a way to tell the API Updater not to run when a Unity project is opened? Or more helpfully, is there a way to to disable the API Update popup dialog?
     
  49. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,167
    Hi Guys!

    I'm currently seeing an issue on Unity 2019 with the API Updater, it seems it updates fine the dll of my asset just fine for the runtime dll, but not for the Editor dll, so my asset is not able to show the custom inspector i have wrote, what seems weird is, that i never get the confirmation dialogue from the API Updater at all, but since i can run the demo scenes, i think it did the update for the runtime dll, but all editor stuff is just throwing errors which i know are updated on Unity 2018 (is about the Texture2D.LoadImage method that was moved to an extension).

    If i do copy the Editor dll from Unity 2018 (already updated) it works normal and as expected.

    Also i tried to run the API Updater manually via the Assets/Run Api Updater option on then Unity menu but it is disabled :(

    Anything i could do to solve this issue? this would be a big problem if people starts using my asset on the latest unity 2019 version :confused:

    Thanks!
     
  50. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    243
    Hi

    That is odd. ApiUpdater should not change anything before getting a confirmation from the user.

    Anyway, you can verify that the assembly got updated or not by looking into the Editor.log and searching for calls to *AssemblyUpdater update -a /path-to-your-assembly*

    Can you create a simple project, add your package (make sure you pick the one with assemblies that you are sure not to be updated) and send me the log? If you can do the same with 2018.3 it would help me to debug.

    That option is enabled only *if we detected* something needs to be updated *and* user declines running ApiUpdater.

    One alternative is to change your code to use the new API (but that would mean it could not be used in older versions of Unity).

    Which API exactly are you

    What is the name of your package (I assume it is in the asset store right) ?

    How can I reproduce it ? Just create an empty project and add your package? (how can I verify it worked / did not worked ?)

    Which exact version of Unity are you using ?

    Best

    Adriano