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

Peer not authenticated in AndroidStudio, but not on commandline-gradle
White text under buttons in layout
How can I access a component(for example a timepicker) in one activity from another activity in Android?
Google play shows error code 504 for Android N preview
How to load image from writeable folder and assign to ImageView in Android?
EditText updates items on ListView with TextWatcher
FTDriver.java mDevice null error
How to use Android NavigationDrawer to create other fragments?
Android Studio resource not found after duplicate
ListView scroll position jumps to first element after notifydatasetchanged
Finger print lock in Android
Why doesn't my BTLE virtual beacon show in Chrome?
Android View Id's
Xamarin Costs to Publish on Google Play Store
UnsupportedOperationException on TextInputLayout when type count exceeded counterMaxLength
set an image background on a scrolling activity

Categories

HOME
django
fuelux
rdbms
google-spreadsheet
database-normalization
google-apps
emscripten
nested-if
maxscript
bookmarks
code-coverage
crystal-reports-2013
recordrtc
google-chrome-app
line
opengl-es-3.0
naivebayes
heat
searchview
fileserver
easyphp
nim
swagger-2.0
boost-icl
microsoft-ocr
rubymotion
jboss6.x
pic32
nstimer
handler
angular-translate
calculation
autolisp
rselenium
simplecv
clickjacking
engine.io
diacritics
tasm
dbnull
bindingnavigator
x++
openresty
magento-2.0.7
twilio-click-to-call
x-ray
amq
appdomain
filehandle
sundials
mathcad
vcloud-director-rest-api
actor-platform
google-query-language
aurora
sklearn-pandas
ikiwiki
pushbots
kendo-upload
highland.js
concurrentmodification
sapi
ess
sony-lifelog-api
mod-proxy
apache-commons-daemon
google-refine
mmwormhole
openbabel
entry-point
functional-java
grails-plugin-rabbitmq
synapse
amslidemenu
gtm-oauth2
android-sdk-2.3
boost-msm
fusefabric
mapping-by-code
hibernateexception
ikimagebrowserview
google-floodlight
quotation-marks
appledoc
dot-emacs
isapi-extension
lalr
visualj#
google-wave
technical-debt
blind

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