Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during build 'Cannot build player while editor is importing assets or compiling scripts' #475

Open
samcsss opened this issue Jan 30, 2025 · 0 comments · May be fixed by #476
Open
Labels

Comments

@samcsss
Copy link

samcsss commented Jan 30, 2025

  • [✔️ ] I am at the right place and my issue is directly related to ROS#. General technical questions I would post e.g. at ROS Answers or Stack Overflow. For library-specific questions I would look for help in the corresponding library forums.
  • [✔️ ] I have thoroughly read the Contributing Guideline and writing this issue is the right thing to do in my case.

  • [✔️ ] I am using the latest ROS# version available here on the master branch.

  • [ ✔️] I am adding all required information, code and data files, screenshots and log files so that you can reproduce the problem.

  • My OS is: Windows 11

  • My Unity Version is: Unity 6 (6000.0.34f1)

  • My ROS Distribution is: Foxy

  • My Build Target Platform is: Windows

Here is my bug description:
The player will not build when the ROS# package is installed.

When building the project, during the build process the build window will display the message "Cannot build player while editor is importing assets or compiling scripts"

The build process fails.

All C# scripts were removed from the project so that I could verify nothing on my end was causing the problem.

I have set the Scripting Backend to Mono, and API Compatibility Level to .NET Framework in the Project Settings
I'm using the ROS# 2.1.0 package

Apologies if I've missed something obvious, bit I'm a bit lost with this one.
From digging into this issue I've read that the main cause of this error is including the UnityEditor namespace in release code, but I can't find anywhere obvious in the package where this is happening.
All I can think is that the '#" in the package's folder name is giving Unity a hard time

Perform the following steps reproduce the bug:

Observed results:

Image

Expected results:
An new project with only the ROS# package added should be able to successfully build

(I know that I may be pushing the limits of what may be supported, but the package works fine with Unity 6 when running in the Editor).

Relevant Code:
relevant code inside the package was not immediately apparent

@samcsss samcsss added the bug label Jan 30, 2025
samcsss pushed a commit to samcsss/ros-sharp that referenced this issue Jan 31, 2025
fixes for Error during build 'Cannot build player while editor is importing assets or compiling scripts' siemens#475
Editor must be listed as a platform in the asmdef file.
runtime code can not refer to UntiyEditor
@samcsss samcsss linked a pull request Jan 31, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant