magicblock-labs / magicblock-labs/Solana.Unity-SDK

[Bug] Android IL2CPP build fails: UnityLinker can’t resolve BouncyCastle.Cryptography with v1.2.9

Open
#257 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C#
Stars
199
Forks
128
PR merge metrics
No merged PRs in 30d

Description

**Bug summary**
After install v1.2.9, Android IL2CPP builds consistently fail during the Unity CIL Linker step with an assembly resolution error for BouncyCastle.Cryptography (2.x). Unity can’t find that assembly even when I add the DLL manually.

Error log (Editor.log excerpt)
`Building Library\Bee\artifacts\Android\ManagedStripped failed with output:
D:\Unity\Hub\Editor\6000.1.8f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe @Library\Bee\artifacts\rsp\16162982357633868796.rsp
Fatal error in Unity CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
at Unity.IL2CPP.Common.MissingMethodStubber.GetTypeModule(...)
at Unity.Linker.Steps.AddUnresolvedStubsStep.MarkAssemblyOfType(...)
at Unity.Linker.Steps.Marking.UnresolvedStubMarking.HandleUnresolvedType(...)
...
UnityEditor.EditorApplication:Internal_CallDelayFunctions ()
`

**To Reproduce**
1. Create a new Unity project (Unity 6000.1.8f1).
2. Add Solana.Unity-SDK v1.2.9 via Package Manager (Git URL).
3. Switch to Android, set IL2CPP / ARM64.
4. Build → Linker fails with Failed to resolve assembly: 'BouncyCastle.Cryptography, Version=2.0.0.0'.

**Expected behavior**
Android IL2CPP build succeeds (the SDK resolves its crypto dependency without manual intervention).

**Unity versions tested**
-6000.1.8f1 (primary)
-6000.2.7f2 (also repros)

**Platform / Build settings:**
-Target: Android
-Scripting Backend: IL2CPP
-Architecture: ARM64
-Managed Stripping Level: (tried Low/Medium)
-OS: Windows

**Additional context**
Even with BouncyCastle.Cryptography.dll (2.x, netstandard2.0) present and enabled for Android, the .rsp used by UnityLinker appears to omit the 2.x DLL (linker still reports it missing)

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in a Unity 6000.1.8f1 project using Solana.Unity-SDK v1.2.9, Android, IL2CPP, and ARM64. Inspect the package dependency configuration and generated UnityLinker .rsp to determine why BouncyCastle.Cryptography 2.x is omitted; done means the Android IL2CPP build succeeds without manually adding the DLL.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp, unity
Domain
build-system, game-dev, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.