0
\$\begingroup\$

I have a project with EMP imported, and now I would like to use assembly definitions to clean up my project a little bit. Everything works fine in the editor, but when I hit Build player script in my Addressables or just trying to Build I get a bunch of nasty error messages. When I switch to VS obviously there are no issues in the code editor. I have asmdef files in:

  1. Core folder in my Scripts folder, these are scripts created by myself. -asmdef
  2. EMP-Editor folder -> this one references 3. -asmref
  3. EMP-Scripts folder -asmdef

There are the kind of errormessages coming up(when trying to build only, there are 200 of them):

Assets\Plugins\EasyMobile\Editor\EM_BuiltinObjectCreator.cs(6,19): error CS0234: The type or namespace name 'SceneManagement' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\Plugins\EasyMobile\Editor\EM_SettingsEditor_Privacy.cs(9,24): error CS0234: The type or namespace name 'SerializedProperty' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\Plugins\EasyMobile\Editor\EM_SettingsEditor_Privacy.cs(10,24): error CS0234: The type or namespace name 'EditorStyles' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)

I tried adding a refernece to the Unity.Editor dll in VS to the EMP assembly, but VS just doesn't do anything, no errors, no messages...Tried the same in asmdef file in Unity with no luck...

I got the inspiration from this video, and it was working ok...

Unity 2019.3
VS 2019
Android platform
EMP 2.5.2

Thanks

\$\endgroup\$
2
  • 1
    \$\begingroup\$ It looks like you've built the editor tools into your assembly too. Those rely on the Unity Editor, which is not packaged in when making a build, so these dependencies fail. You'll want to separate the assembly you use for runtime stuff from the editor scripts. \$\endgroup\$
    – DMGregory
    May 18, 2020 at 14:12
  • \$\begingroup\$ I'll have a look, thanks! \$\endgroup\$ May 18, 2020 at 22:01

1 Answer 1

0
\$\begingroup\$

I just unchecked Android on my asmdef at the platforms section, as DMGregory suggested and voila. It works! Many thanks!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ For precision, that's not something I suggested above. But if it works for you, I'm glad. :) \$\endgroup\$
    – DMGregory
    May 20, 2020 at 14:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .