Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Xamarin Java.Interop error?

Tags:

java

c#

xamarin

Hello since the last Xamarin update we get this error.

CS0012 The type 'IJavaPeerable' is defined in an assembly that is not referenced. You must add a reference to assembly 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. ImageLibrary C:\Users\rutge\Source\Repos\GarderobeApp\ImageSwiper\ImageSwiper.cs 33 Active

Does anybody have an idea what this means?

like image 764
highwaydog Avatar asked Jun 13 '16 11:06

highwaydog


2 Answers

In my case it was a bit different, I couldn't find monoandroid folder in

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework. 

So on further I searched and found it in

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid

This might be the case with someone else.

like image 61
Rohan Sampat Avatar answered Sep 17 '22 18:09

Rohan Sampat


I go the same error after the last update. You just have to add the reference to Java.Interop to resolve the problem.

  1. Go to your Android project
  2. Right Click in reference and choose "Add Reference"
  3. On Assembly, look for Java.Interop and add it
  4. Rebuild your project

If you need some screenshots, I can provide them later.

like image 29
OrcusZ Avatar answered Sep 21 '22 18:09

OrcusZ