amplitude / unity-plugin

Official Amplitude Unity Plugin
https://developers.amplitude.com/docs/unity
MIT License
44 stars 34 forks source link

Unity 2019.3 PostProcess issue #37

Closed mystikxkemix closed 4 years ago

mystikxkemix commented 4 years ago

Hi,

On Unity 2019.3, all the frameworks are linked to the new target UnityFramework. However, your PostProcess script change flags for Unity-iPhone target.

You need to change this line: var targetGuid = proj.TargetGuidByName(PBXProject.GetUnityTargetName()); by those:

#if UNITY_2019_3_OR_NEWER
      var targetGuid = proj.TargetGuidByName(proj.GetUnityFrameworkTargetGuid());
#else
      var targetGuid = proj.TargetGuidByName(PBXProject.GetUnityTargetName());
#endif

Hope you will fix this soon 🙃

Ilya-d commented 4 years ago

Unity 2019.3.11f does not compile current amplitude plugin. GetUnityTargetName is deprecated.

haoliu-amp commented 4 years ago

@mystikxkemix @Ilya-d Thank you for all the info! Actually the change should be

#if UNITY_2019_3_OR_NEWER
      var targetGuid = proj.GetUnityFrameworkTargetGuid();
#else
      var targetGuid = proj.TargetGuidByName(PBXProject.GetUnityTargetName());
#endif
haoliu-amp commented 4 years ago

https://github.com/amplitude/unity-plugin/releases/tag/v1.2.0