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

Cannot build for Android in Unity 6 #478

Open
4 tasks done
silasalves opened this issue Feb 14, 2025 · 1 comment · May be fixed by #479
Open
4 tasks done

Cannot build for Android in Unity 6 #478

silasalves opened this issue Feb 14, 2025 · 1 comment · May be fixed by #479
Labels

Comments

@silasalves
Copy link

  • 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: 6.0 (6000.028f1 and 6000.038f1)

  • My ROS Distribution is: ROS2 Jazzy

  • My Build Target Platform is: Android

Here is my bug description:

Compilation fails:

Library\PackageCache\com.siemens.ros-sharp@f2272aed2752\Runtime\RosBridgeClient\RosCommunication\UnityFibonacciActionSever.cs(61,35): error CS0246: The type or namespace name 'PropertyDrawer' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.siemens.ros-sharp@f2272aed2752\Runtime\RosBridgeClient\RosCommunication\UnityFibonacciActionSever.cs(60,6): error CS0246: The type or namespace name 'CustomPropertyDrawerAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.siemens.ros-sharp@f2272aed2752\Runtime\RosBridgeClient\RosCommunication\UnityFibonacciActionSever.cs(60,6): error CS0246: The type or namespace name 'CustomPropertyDrawer' could not be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.siemens.ros-sharp@f2272aed2752\Runtime\RosBridgeClient\RosCommunication\UnityFibonacciActionSever.cs(63,51): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)

Error building Player because scripts had compiler errors

Perform the following steps reproduce the bug: Try to compile any sample with ros-sharp code.

Observed results: Building the APK fails.

Expected results: The APK file would be created.

@StepanStulov
Copy link

This is due to the misconfiguration of the assembly definition at the com.siemens.ros-sharp/Editor/siemens.ros-sharp.Editor.asmdef file. It's marked as Any Platform instead of being Editor (see picture).

Note, that it's not conventional to surround Editor-only (the ones having ../Editor/.. in their path) scripts with the #if UNITY_EDITOR pre-processor directives. That directive is for injecting fragments of Editor code into Runtime code. It is not for Editor-only scripts. Please do not use this solution and fix the assembly definition file instead. That's the "Unity way".

Image

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.

2 participants