我使用的是VS2013,Xamarin.Android 4.12.4.20。
建造是成功的。
每当我试图在调试模式或包中部署时,我都会从标题中得到错误。这件事从今天开始就发生了,以前很好用。
我重新启动了VS,设备,个人电脑-没有任何帮助。
堆栈跟踪:
Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Mono.AndroidTools.Adb.AdbSyncDirectory.Add(AdbSyncItem entry)
at Xamarin.AndroidTools.AndroidDeploySession.InstallAssemblies(String destinationPath, CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.FastDev()
at Xamarin.AndroidTools.AndroidDeploySession.Run(CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token)
--- End of inner exception stack trace ---
at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.Start(CancellationToken token)
生成输出:
3>Build succeeded.
3>Waiting for device..
3>Detecting installed packages
3>Detecting installed packages...
3>
3>Removing previous version of application
3>Removing previous version of application...
3>
3>Installing application on device
3>Copying application to device...
3>
3>Getting installation path...
发布于 2014-07-15 12:00:10
我已经想明白了。确保您没有引用相同dll的不同版本!!
让我描述一下我的设置,这将有助于解释为什么会出现异常。
我有两个项目
两者都有对同一个库的nuget引用。在某种程度上,android (仅在这个项目中)更新了nuget引用,这导致了应用程序所需的两个版本的相同库(Domain仍然引用旧nuget)。
当我试图打包解决方案时,我会收到如下警告:
Consider app.config remapping of assembly "{Library}" from Version "5.6.0.0" [] to Version "5.6.1.0" [{Path}] to solve conflict and get rid of warning.
一旦我更新了域的nuget,一切都成功了。
https://stackoverflow.com/questions/24725163
复制相似问题