error : java.lang.IllegalArgumentException: already added : Lbolts/AggregateException;

Hello,

I'm trying to compile an old xamarin android native app, not developed by me, but I got the following exception in the output when I try to buid:

1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AggregateException; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$1; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$UIThreadExecutor; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AppLink; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AppLink$Target; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AppLinkNavigation; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AppLinkNavigation$1; 1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AppLinkNavigation$NavigationResult; 1> 1> UNEXPECTED TOP-LEVEL EXCEPTION: 1> java.lang.RuntimeException: Translation has been interrupted 1> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:613) 1> at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311) 1> at com.android.dx.command.dexer.Main.run(Main.java:277) 1> at com.android.dx.command.dexer.Main.main(Main.java:245) 1> at com.android.dx.command.Main.main(Main.java:106) 1> Caused by: java.lang.InterruptedException: Too many errors 1> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:605) 1> ... 4 more 1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2075,3): error : java.lang.IllegalArgumentException: already added : Lbolts/AggregateException;

As far I understood, there should be a duplicate jar library, but I have no idea how to find it, here there is the list of references:

<Reference Include="AndHUD, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\AndHUD.1.2.0\lib\MonoAndroid\AndHUD.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Bolts.AppLinks, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Bolts.1.4.0.1\lib\MonoAndroid403\Bolts.AppLinks.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Bolts.Tasks, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Bolts.1.4.0.1\lib\MonoAndroid403\Bolts.Tasks.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="HockeySDK, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\HockeySDK.Xamarin.4.1.1\lib\MonoAndroid403\HockeySDK.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="HockeySDK.AndroidBindings, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\HockeySDK.Xamarin.4.1.1\lib\MonoAndroid403\HockeySDK.AndroidBindings.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Mono.Android.Export" /> <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="NodaTime, Version=1.3.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL"> <HintPath>..\..\packages\NodaTime.1.3.2\lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1+XamariniOS1\NodaTime.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="NodaTime.Serialization.JsonNet, Version=1.3.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL"> <HintPath>..\..\packages\NodaTime.Serialization.JsonNet.1.3.2\lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\NodaTime.Serialization.JsonNet.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="ParsePushBinding, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>Libs\ParsePushBinding\ParsePushBinding.dll</HintPath> </Reference> <Reference Include="Plugin.Connectivity, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xam.Plugin.Connectivity.2.3.0\lib\MonoAndroid10\Plugin.Connectivity.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Plugin.Connectivity.Abstractions, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xam.Plugin.Connectivity.2.3.0\lib\MonoAndroid10\Plugin.Connectivity.Abstractions.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Plugin.Settings, Version=2.5.4.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xam.Plugins.Settings.2.5.4\lib\MonoAndroid10\Plugin.Settings.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Plugin.Settings.Abstractions, Version=2.5.4.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xam.Plugins.Settings.2.5.4\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Polenter.SharpSerializer.PCL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8f4f20011571ee5f, processorArchitecture=MSIL"> <HintPath>..\..\packages\SharpSerializer.PCL.2.18.7\lib\portable-net45+sl50+win+wpa81+wp80\Polenter.SharpSerializer.PCL.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\RestSharp.105.2.3\lib\MonoAndroid10\RestSharp.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Xml" /> <Reference Include="System.Core" /> <Reference Include="Mono.Android" /> <Reference Include="Xamarin.Android.Support.Animated.Vector.Drawable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.Compat.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.Compat.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.Core.UI.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.Core.UI.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.Core.Utils, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.Core.Utils.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.Core.Utils.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.CustomTabs, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.CustomTabs.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.CustomTabs.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.Fragment.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.Fragment.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.Media.Compat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.Media.Compat.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.Media.Compat.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.v4.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.v4.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.v7.AppCompat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.v7.AppCompat.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.v7.CardView, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.v7.CardView.23.4.0.1\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.v7.MediaRouter, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.v7.MediaRouter.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.v7.Palette, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.v7.Palette.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.v7.Palette.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Android.Support.Vector.Drawable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Android.Support.Vector.Drawable.25.1.0\lib\MonoAndroid70\Xamarin.Android.Support.Vector.Drawable.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Facebook, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Facebook.Android.4.16.1\lib\MonoAndroid403\Xamarin.Facebook.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Firebase.Analytics, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Firebase.Analytics.42.1001.0\lib\MonoAndroid70\Xamarin.Firebase.Analytics.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Firebase.Analytics.Impl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Firebase.Analytics.Impl.42.1001.0\lib\MonoAndroid70\Xamarin.Firebase.Analytics.Impl.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Firebase.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Firebase.Common.42.1001.0\lib\MonoAndroid70\Xamarin.Firebase.Common.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.Firebase.Iid, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Firebase.Iid.42.1001.0\lib\MonoAndroid70\Xamarin.Firebase.Iid.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.GooglePlayServices.Analytics, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.GooglePlayServices.Analytics.42.1001.0\lib\MonoAndroid70\Xamarin.GooglePlayServices.Analytics.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.GooglePlayServices.Analytics.Impl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.GooglePlayServices.Analytics.Impl.42.1001.0\lib\MonoAndroid70\Xamarin.GooglePlayServices.Analytics.Impl.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.GooglePlayServices.Base, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.GooglePlayServices.Base.42.1001.0\lib\MonoAndroid70\Xamarin.GooglePlayServices.Base.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.GooglePlayServices.Basement, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.GooglePlayServices.Basement.42.1001.0\lib\MonoAndroid70\Xamarin.GooglePlayServices.Basement.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.GooglePlayServices.TagManager.V4.Impl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.GooglePlayServices.TagManager.V4.Impl.42.1001.0\lib\MonoAndroid70\Xamarin.GooglePlayServices.TagManager.V4.Impl.dll</HintPath> <Private>True</Private> </Reference> <Reference Include="Xamarin.GooglePlayServices.Tasks, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.GooglePlayServices.Tasks.42.1001.0\lib\MonoAndroid70\Xamarin.GooglePlayServices.Tasks.dll</HintPath> <Private>True</Private> </Reference>

How to resolve this issue?
Thanks

Answers

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Your best bet is to use grep and do a grep search at the project directory so it will search through the .dll as well. You should be able to do it on one of the classes that is a duplicate. Then you can find where the duplicate is coming from. On Windows I use grepWin.

  • @JonDouglas said:
    Your best bet is to use grep and do a grep search at the project directory so it will search through the .dll as well. You should be able to do it on one of the classes that is a duplicate. Then you can find where the duplicate is coming from. On Windows I use grepWin.

    thanks, unfortunately it didn't help, or at least I wasn't able to search it properly... but I took the chance to create a new clean solution, with all updated and only needed libraries and targeted SDK :)

Sign In or Register to comment.