没有办法解决之间的冲突。我尝试卸载Visual Studio,修复Visual Studio,但仍然没用。
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" y "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Se elegirá "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" de manera arbitraria.
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/AnimRes;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/AnimatorRes;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/AnyRes;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/AnyThread;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/ArrayRes;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/AttrRes;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/BinderThread;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/BoolRes;
1> Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/CallSuper;
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:614)
1> at com.android.dx.command.dexer.Main.runMonoDex(Main.java:310)
1> at com.android.dx.command.dexer.Main.runDx(Main.java:288)
1> at com.android.dx.command.dexer.Main.main(Main.java:244)
1> at com.android.dx.command.Main.main(Main.java:95)
1> Caused by: java.lang.InterruptedException: Too many errors
1> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:606)
1> ... 4 more
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2816,3): error : java.lang.IllegalArgumentException: already added : Landroid/support/annotation/AnimRes;
答案 0 :(得分:0)
多亏了Leon Lu-MSFT的评论,我部分解决了该问题。 当我更新要在Xamarin.Android项目中使用的软件包时,无意中安装了:Xamarin.Android.Support.Core.UI和Crosslight.Xamarin.Android.Support.Core.UI,这反过来给我错误: java.lang.IllegalArgumentException:已添加:Landroid / support / annotation / AnimRes
我清理了裸露的小包,并删除了“ Crosslight.Xamarin.Android.Support.Core.UI”,这已由我解决。
我无法使用Leon Lu-MSFT建议的步骤,但是我使用命令进行了等效操作。如您在下面的步骤中所见。
*首先尝试* 在开始这些步骤之前,我将仔细检查您是否有任何NuGet软件包(我的软件包重复的原因),将其删除并进行构建。
如果这不起作用,请尝试以下步骤:
希望有帮助!