Skip to content

chore: Move bepu asset compilation to Stride.Assets - #2963

Merged
xen2 merged 1 commit into
stride3d:masterfrom
Eideren:bepu_move_assets
Nov 9, 2025
Merged

chore: Move bepu asset compilation to Stride.Assets#2963
xen2 merged 1 commit into
stride3d:masterfrom
Eideren:bepu_move_assets

Conversation

@Eideren

@Eideren Eideren commented Nov 9, 2025

Copy link
Copy Markdown
Collaborator

PR Details

This PR is to fix the mobile builds according to Xen2.
Doesn't seem to work at the moment, Stride.Core.Assets.CompilerApp.dll throws the following when building a game:

Unhandled exception. System.TypeInitializationException: The type initializer for '<Module>' threw an exception.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'Stride.BepuPhysics, Version=4.3.0.1, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Stride.BepuPhysics, Version=4.3.0.1, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
   at System.Reflection.TypeNameResolver.ResolveAssembly(AssemblyName assemblyName)
   at System.Reflection.TypeNameResolver.GetType(String escapedTypeName, ReadOnlySpan`1 nestedTypeNames, TypeName parsedName)
   at System.Reflection.TypeNameResolver.GetSimpleType(TypeName typeName)
   at System.Reflection.TypeNameResolver.Resolve(TypeName typeName)
   at System.Reflection.TypeNameResolver.GetTypeHelper(ReadOnlySpan`1 typeName, RuntimeAssembly requestingAssembly, Boolean throwOnError, Boolean requireAssemblyQualifiedName, IntPtr unsafeAccessorMethod)
   at System.Reflection.TypeNameResolver.GetTypeHelper(Char* pTypeName, RuntimeAssembly requestingAssembly, Boolean throwOnError, Boolean requireAssemblyQualifiedName, IntPtr unsafeAccessorMethod)
   at System.Reflection.CustomAttribute.CreateCustomAttributeInstance(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(MemberInfo element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](MemberInfo element)
   at Stride.Core.Assets.AssetRegistry.RegisterAssetAssembly(Assembly assembly) in I:\stride\sources\assets\Stride.Core.Assets\AssetRegistry.cs:line 740
   at Stride.Core.Assets.AssetRegistry.AssemblyRegistryAssemblyRegistered(Object sender, AssemblyRegisteredEventArgs e) in I:\stride\sources\assets\Stride.Core.Assets\AssetRegistry.cs:line 921
   at Stride.Core.Reflection.AssemblyRegistry.OnAssemblyRegistered(Assembly assembly, HashSet`1 categories) in I:\stride\sources\core\Stride.Core\Reflection\AssemblyRegistry.cs:line 273
   at Stride.Core.Reflection.AssemblyRegistry.Register(Assembly assembly, IEnumerable`1 categories) in I:\stride\sources\core\Stride.Core\Reflection\AssemblyRegistry.cs:line 219
   at Stride.Core.Reflection.AssemblyRegistry.Register(Assembly assembly, String[] categories) in I:\stride\sources\core\Stride.Core\Reflection\AssemblyRegistry.cs:line 235
   at Stride.Assets.Module.Initialize() in I:\stride\sources\engine\Stride.Assets\Module.cs:line 27
   at Stride.Core.CompilerServices.AutoGenerated.ModuleInitializer.<ModuleInitializer>F9E322EED9579C806C755BDF3A0BE6990EDC9D62942016A78876D14BC2C3418C7__ModuleInitializer.Initialize() in I:\stride\sources\engine\Stride.Assets\obj\Debug\net10.0\Stride.Core.CompilerServices\Stride.Core.CompilerServices.Generators.ModuleInitializerGenerator\ModuleInitializer.cs:line 9
   at .cctor()
   --- End of inner exception stack trace ---
   at Stride.Core.DataSerializers.Stride_Core_Assets_CompilerAppSerializerFactory.Initialize()
   at Stride.Core.DataSerializers.Stride_Core_Assets_CompilerAppSerializerFactory.Initialize()
   at .cctor()

There's a bunch of unnecessary changes I added in to pinpoint where this issue could come from to no avail.

Related Issue

N/A

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@xen2
xen2 marked this pull request as ready for review November 9, 2025 14:29
@xen2
xen2 merged commit e7bb2de into stride3d:master Nov 9, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants