mobfishgmbh / Cardboard-VR-Unity-SDK

Apache License 2.0
56 stars 11 forks source link

Deprecated Building Method in 2019.3+ #51

Closed daltonbr closed 4 years ago

daltonbr commented 4 years ago

At line 33 in Cardboard/Editor/CardboardEditorHelper.cs

string target = proj.TargetGuidByName("Unity-iPhone");

Got this error

Error building Player: Exception: Calling TargetGuidByName with name='Unity-iPhone' is deprecated. There are two targets now, call GetUnityMainTargetGuid() - for app or GetUnityFrameworkTargetGuid() - for source/plugins to get Guid instead.

My trivial solution was this.

#if UNITY_2019_3_OR_NEWER
            string target = proj.GetUnityMainTargetGuid();
#else
            string target = proj.TargetGuidByName("Unity-iPhone");
#endif
cai-mobfish commented 4 years ago

Just going to create this issue and found this issue is already created.

2 points here:

Fix is in testing and is on the way.

daltonbr commented 4 years ago

Very interesting, I was a bit confused by the documentation. Great job @cai-mobfish! 👏

cai-mobfish commented 4 years ago

@daltonbr You can create a new ticket if documentation is not clear for you.