Hi,
In Unity 2017+ using asmdef files counters Unity figuring out "Editor" folders to be excluded on builds. Causing build failures with for instance playfab unity SDK.
We have to manually exclude them with an editor only asmdef.
Below our current workaround moving all editor folders in one place and adding an asmdef,
Best
Answer by MarcoWilliamsPF · Jul 31, 2018 at 03:28 PM
We will look into this issue. I'll file a ticket for investigation.
As far as I know Editor Extensions and any Editor files in the PlayFab SDKs do not cause compile or build errors in any Unity Versions (tested on all versions post Unity 5.6).
So I'm confused as to what the repro steps are to make that happen. Can you provide steps to reproduce this issue?
I'd believe @contact-3 used assembly definition files which is newly added in Unity 2017.3. To reproduce this issue, we can add a .asmdef file under "PlayFabSdk" folder. Then when we try to build the project we will get some build error. This is because Unity gives priority to the assembly definition files over the Predefined Compilation System. And this will cause "Editor" folders in PlayFabSdk have wrong references. There are some discussions about this issue like https://forum.unity.com/threads/example-project-assembly-definition-files.482313/page-4#post-3296568. As PlayFabSdk does not use assembly definition files, I don't think this is a SDK issue. But if all editor related files in PlayFabSdk can be put in one folder might be helpful for @contact-3's issue.
Yes it will concern unity 2017.2+ builds when you need to have a reference to playfabSDK while you're using your own asmdef for your code. In order for it to work with current version of the SDK you must 1. Put an asmdef file ie"playfab-sdk" in the root folder of playfab. 2. Put together all editor only files with their own asmdef "playfab-sdk-editor" (with editor only setting as stated in my OP) 3. Reference "playfab-sdk" in "playfab-sdk-editor" asmdef. Then you can reference playfab sdk in your own assemblies if needed.
Answer by Jay Zuo · Jul 31, 2018 at 09:41 AM
PlayFab Unity SDK does not use assembly definition files. And for the "Editor" folders issue, this is because
Unity gives priority to the assembly definition files over the Predefined Compilation System. This means that having any of the special folder names from the predefined compilation inside a assembly definition file folder does not have any effect on the compilation. Unity treats these as regular folders without any special meaning.
For more information, see https://forum.unity.com/threads/example-project-assembly-definition-files.482313/page-4#post-3296568
Moving all editor folders into a separate assembly is a workaround, also you can try with "#if UNITY_EDITOR #endif" block like in this answer.
Unity Download Content from CDN before Log-in,Download content with CDN before login 1 Answer
OAuth consent screen and Playfab: Can't verify because I don't own playfab.com domain 3 Answers
Catalog's Item Custom Data 1 Answer
What happened to the OneSignal addon? (having iOS push errors with PlayFab) 1 Answer