[Unity, AR] Error: “CS0619: UnityEngine.Network is obsolete”, When CloudAnchors is upgraded to Unity 2018.2

This time, I’ll introduce about Tips for those who use ARCore provided by Google with Unity. If you were developing with CloudAnchors on Unity 2017, and upgrading to the latest Unity 2018.2 (as of October 2018), you will encounter the error of above screen shot.

“Assets/GoogleARCore/Examples/CloudAnchors/Scripts/CloudAnchorUIController.cs(85,62): error CS0619: `UnityEngine.Network’ is obsolete: `The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.’ ”

(I think if possible, you should not do upgrading Unity during developing. It includes the possibility of various errors other than this. Especially when you use something like Asset. You might need time to investigate the Asset.)

I think you can find the cause of the error immediately, but it is the IP address acquisition part in the Start method of ‘CloudAnchorUIController.cs’.

 

[Cause of Error]

The point is that the ‘UnityEngine.Network’ class is no longer used in Unity 2018.2 as in the following Bag Fix.

Bug fixes:

Fixed ‘UnityEngine.Network’ is obsolete: The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.’ in Unity 2018.2 and above.

[ URL:https://github.com/google-ar/arcore-unity-sdk/releases ]

 

[Error Solution]

Download the latest ‘ARCore SDK for Unity‘ from the following site and import it. The latest version when I downloaded is v1.5.0.

[ URL : https://github.com/google-ar/arcore-unity-sdk/releases ]

This error can be easily avoided with this.

And the following errors that occurred at the same time are also resolved by the same solution.

“Assets/GoogleARCore/Examples/CloudAnchors/Scripts/CloudAnchorUIController.cs(85,62): error CS0619: `UnityEngine.Network.player’ is obsolete: `The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.’”

“Assets/GoogleARCore/Examples/CloudAnchors/Scripts/CloudAnchorUIController.cs(85,69): error CS0619: `UnityEngine.NetworkPlayer.ipAddress’ is obsolete: `The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.'”

 

[Important Points]

  1. If you are directly editing standard script in ARCore, you should take backups beforehand. Don’t forget. It will be overwritten and will be gone.
  2. When importing the latest ARCore package, you should delete the ARCore package that was previously installed before importing. Otherwise, the following error occurs at build time.

Error: Duplicate file(s) in apk:

 

This was about how to resolve errors that occurred when upgrading to Unity 2018.2 when using ARCore.

 

[Original Japanese Site: http://blog.lab7.biz/archives/13196323.html]

 

Leave a Reply

Your email address will not be published. Required fields are marked *