android


Using protobuf-net in android


I'm using protobuf-net from the nuget package.
When I have add the package to my xamaring android project I get and error on build telling me I have multiple versions of the following assemblies:
System.Reflection.Emit.ILGengeration
System.Reflection.Emit.Lightweight
protobuf-net targets .netstandard and has added references to the above two assemblies. There are no other references in the project file (no duplicate) so I'm assuming that these assemblies are part of the standard xamarin in some way. If I remove the references then everything builds fine from Visual Studio.
However our build system uses MSBuild and that fails to build with the following error:
errorMSB4018: The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Reflection.MethodInfo System.Reflection.TypeExtensions::GetMethod(System.Type,System.String,System.Reflection.BindingFlags)' (defined in 'protobuf-net, Version=2.1.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67') from 'protobuf-net, Version=2.1.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Reflection.MethodInfo System.Reflection.TypeExtensions::GetMethod(System.Type,System.String,System.Reflection.BindingFlags)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
--- End of inner exception stack trace ---
at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
It appears that protobuf-net is trying to use a method from the assemblies I had to remove because of the duplicate error.
How can I make the msbuild work when using protobuf-net from and Xamarin android project?

Related Links

How to bring ImageView in front of Button in android 5?
How to set time by location Android
Shell script to extract image of an Android mobile
androidTestCompile and dependency on another module ends with ClassNotFoundException
Not able to create Sqlite database in Cordova
Animate listview rows, what is the proper place to do this?
Removing renamed/deleted folders from git tracking
Customize notification received with parse
How to repeat process of random position and image with this code
Problems of security code of android app when interacting with Java RESTful services
Push notification not receiving android
How can I design Material for older versions?
Google Glass unable to detect device compatibility with latest version
Google Analytics Android Real Time
Helper Activity to display Fragment?
I want to change .android folder [duplicate]

Categories

HOME
google-cloud-platform
paraview
polymer
pagination
gpu
interface
dojo
jetty
settings
mapbox
frontend
vert.x
nstableheaderview
32bit-64bit
appcelerator-studio
frequency-distribution
shared-libraries
atlassian
3nf
capistrano3
package.json
powershell-v5.0
mathprog
fileserver
forgot-password
smartclient
connector
sencha-touch
ag
squashfs
event-store
aggregation
jquery-callback
android-maps
intersystems-cache
bioinformatics
failover
twiml
magento-1.8
memory-address
spring-security4
dynamic-jasper
slacktextviewcontroller
servicestack-text
reactivekit
protein-database
hackintosh
android-ibeacon
fwrite
clarifai
tinymce-3
pair-programming
seq
janus
grails-plugin
hadoop-2.7.2
latin
signalr.client
lean
jtwig
qiime
mediametadataretriever
lua-telegram-bot
nss
evolus-pencil
ember-cli-rails
dulwich
diff3
ejb-2.x
browserify-shim
sonarqube-5.0
metatrader5
personalization
reflector
mysql-error-1044
cmmi
cascadingdropdown
redis-py
panda3d
patricia-trie
isa-swizzling
pinch
matlab-load
android-holo-everywhere
google-ajax-api
tournament
massive
mtu
qglwidget
facebook-iframe
maven-1
interprocess
fdf
soappy
appliance

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App