I am working on a .NET MAUI application (multi-platform), and I need to use FTDI's D2XX library for USB communication on Android. Since the official FTDI SDK for Android is in Java (d2xx.jar), I am using IKVM to convert the .jar file into a .NET assembly (D2XX.dll).
What I Have Done So Far:
- Installed IKVM via NuGet (IKVM package).
- Added IkvmReference to my .csproj so that d2xx.jar is automatically converted to D2XX.dll at build time:
<ItemGroup>
<IkvmReference Include="Platforms/Android/libs/d2xx.jar">
<AssemblyName>D2XX</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Debug>portable</Debug>
</IkvmReference>
</ItemGroup>
- Verified that D2XX.dll is correctly generated in bin/Debug/net8.0-android/.
- Manually copied D2XX.dll to Platforms/Android/libs/.
- Attempted to add it as a reference in my .csproj:
<ItemGroup>
<Reference Include="D2XX">
<HintPath>bin/Debug/net8.0-android/D2XX.dll</HintPath>
<Private>true</Private>
</Reference>
</ItemGroup>
Issue:
Even though D2XX.dll is generated and appears valid when opened in a decompiler (dnSpy/ILSpy), I cannot use it in my C# code (using D2XX; does not work).
Additionally, when I try to manually add D2XX.dll as a reference via Visual Studio Reference Manager, I get the error:
Questions:
- How do I properly reference D2XX.dll in a .NET MAUI project so that using D2XX; works?
- Should I be placing D2XX.dll in a different directory (bin/ vs. Platforms/Android/libs/)?
- Does MAUI require a specific way to reference IKVM-generated assemblies?
Any guidance or best practices for integrating IKVM with .NET MAUI would be greatly appreciated!
I am working on a .NET MAUI application (multi-platform), and I need to use FTDI's D2XX library for USB communication on Android. Since the official FTDI SDK for Android is in Java (d2xx.jar), I am using IKVM to convert the .jar file into a .NET assembly (D2XX.dll).
What I Have Done So Far:
- Installed IKVM via NuGet (IKVM package).
- Added IkvmReference to my .csproj so that d2xx.jar is automatically converted to D2XX.dll at build time:
<ItemGroup>
<IkvmReference Include="Platforms/Android/libs/d2xx.jar">
<AssemblyName>D2XX</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Debug>portable</Debug>
</IkvmReference>
</ItemGroup>
- Verified that D2XX.dll is correctly generated in bin/Debug/net8.0-android/.
- Manually copied D2XX.dll to Platforms/Android/libs/.
- Attempted to add it as a reference in my .csproj:
<ItemGroup>
<Reference Include="D2XX">
<HintPath>bin/Debug/net8.0-android/D2XX.dll</HintPath>
<Private>true</Private>
</Reference>
</ItemGroup>
Issue:
Even though D2XX.dll is generated and appears valid when opened in a decompiler (dnSpy/ILSpy), I cannot use it in my C# code (using D2XX; does not work).
Additionally, when I try to manually add D2XX.dll as a reference via Visual Studio Reference Manager, I get the error:
Questions:
- How do I properly reference D2XX.dll in a .NET MAUI project so that using D2XX; works?
- Should I be placing D2XX.dll in a different directory (bin/ vs. Platforms/Android/libs/)?
- Does MAUI require a specific way to reference IKVM-generated assemblies?
Any guidance or best practices for integrating IKVM with .NET MAUI would be greatly appreciated!
Share Improve this question asked Mar 17 at 5:10 m4verickm4verick 892 silver badges13 bronze badges1 Answer
Reset to default 0There is a near zero percent chance that a Java library intended for usage on Android specifically is going to work with IKVM in the first place. There is also a zero percent chance that IKVM at runtime will work on Android, as we don't even have Android runtime support.