java interop_C# Xamarin Java.Interop error?

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?

neneo

You can found it here

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Java.Interop.dll

then :

Go to your Android project

Right Click in reference and choose "Add Reference"

Browse file location

Add and done

if you still get error, try to rebuild your project

OrcusZ

I go the same error after the last update.

You just have to add the reference to Java.Interop to resolve the problem.

Go to your Android project

Right Click in reference and choose "Add Reference"

On Assembly, look for Java.Interop and add it

Rebuild your project

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

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.

You can hover over the offending line and see the missing DLL.

066424a91c39d32bce198edf3034c087.png

Now add the missing reference;

Open the Solution Explorer, and within References right click, and select Add Reference22c6270d628021a3ceac55a62f6146b2.png

Within the Reference Manager click Browse, and Browse again.

146c87a9fe526df5d29c0e3a267c4838.png

In the file dialog copy and paste this path:

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

46047a854843281e55f746094fc38c13.png

Click Java.Interop.dll

4482fc0a538add22d025525154aae6bd.png

Okay the Reference Manager

Arun Prasad

You can directly copy the assembly Java.Interop.dll from the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0 to the bin/Debug folder of your project to resolve the issue.

This procedure perfectly worked for me.

Thanks,

These errors are not due to a problem with the solution or the references. They are a by-product of other changes that seem to confuse tools like ReSharper. At least this is correct in my case, my solution still compiles and functions without manually referencing any Reference Assemblies.

There is a Xamarin bug report for this but they determined this to be an external issue with ReSharper as per my experience.

Rather than manually adding references to the project you can also tell ReSharper to simply ignore the errors by opening:

ReSharper -> Windows -> Solution Errors

And then ignoring the issues here.

In my case iOS and Android use the seem Business Layer when I run my android application works ok but when I run iOS show me the error You must add a reference to assembly 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'

The problem: I was using JSONObject from Org.Json

this dll just work with android

I need change for JsonObject from System.Json

That was my solution, now my two applications work

来源:https://stackoverflow.com/questions/37788326/c-sharp-xamarin-java-interop-error

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值