1

I'm building a Xamarin.Android application, but I'm having troubles every time I add any Xamarin.GooglePlayServices.* NuGet packages. First time my .csproj was corrupted, and I had to start the project all over and include all files in a new project. I avoided those libs, but now I need them. This time, I get this error

java.lang.illegalargumentexception: already added lokhttp3/address

I've searched for days, but have not been able to find an answer. Anyone who knows how to resolve the java.lang.illegalargumentexception: already added error in Xamarin.Android?

EDIT:

I've found that I can reproduce this error by create a blank Xamarin.Android project and import package XBindings.MapboxLocationLayer.Droid as the only package.

4

2 回答 2

0

移除Naxam.SquareUp.OkHttp3,并启用 Multi-Dex 将成功构建。

两者都Naxam.SquareUp.OkHttp3包含Square.OkHttp3okhttp,因此您需要删除一个。然后你会得到错误:java.exe exited with code 2参考这个,你需要Enable Multi-Dex。

于 2018-01-25T11:35:21.027 回答
0

我是这些库的主要作者,也是NAXAM的创始人,该公司开发了许多绑定库:MAPBOX、BRAINTREE、STRIPE。

我支持解决这个问题。

关于这个问题,请卸载 NAXAM/Xbindings 包,然后只重新安装直接引用包。这是历史问题,很抱歉给您带来不便。

  • 有些人可能也对 Mapbox Navigation 库感兴趣,请仔细阅读我们的自述文件,因为 XAMARIN 尚未发布 Android 支持包

同时,Xamarin 尚未发布 Android.Arch.Core.Runtime 和 Android.Arch.Lifetime.Extensions 的包。请直接在 Visual Studio Nuget Packages Source 中或通过 nuget.config 文件将 nuget 源添加到https://www.myget.org/F/xbindings/api/v3/index.json 。

  • 某些软件包的版本以betaVS 不理解它们作为依赖项结束,请手动添加它们。它们是测试版,因为在创建它们时,本机库是测试版。

干杯。

NAXAM 创始人 Tuyen - https://naxam.net

于 2018-01-28T16:07:00.447 回答