xamarin / java.interop

Java.Interop provides open-source bindings of Java's Java Native Interface (JNI) for use with .NET managed languages such as C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent Java.Interop version

guillaume-tgl opened this issue · comments

I've just published a new version of my Xamarin.Android plugin and users get an error when trying to use it:

CSC : error CS1705: Assembly 'GeniusScanSDK.ScanFlow.Android' with identity 'GeniusScanSDK.ScanFlow.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Java.Interop, Version=0.2.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Java.Interop' with identity 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'

Any idea what's wrong?
Since the previous version, I updated the TargetFrameworkVersion from v11.0 to v12.0, could that be the problem?

There was a lot of back and forth on this, where we changed the Java.Interop.dll version, but then there were problems and we had to revert it: #952.

I do not think it ever shipped in a stable version of Xamarin.Android, but it did ship in a few previews. I would check what version of Xamarin.Android you have installed on the machine that is building the GeniusScanSDK.ScanFlow.Android.dll assembly. It may need to be updated to a more recent version.

I use this Docker image: https://github.com/tafilz/xamarin-android
I see they made some changes 20 days ago but it seems like they use the latest build from https://dev.azure.com/xamarin/public/_build?definitionId=48&_a=summary&view=runs&branchFilter=5767%2C5767%2C5767
Could this be a problem?

Potentially, that pipeline doesn't seem to be running and the builds are from main in Feb 2022.

I would highly suggest finding a way to use official supported builds for Windows or Mac.

Thanks, I've switched my CI machine to a Mac and the issue went away.