xamarin - The "LinkAssemblies" task failed unexpectedly while publishing apk file -
i using xamarin forms develop mobile app.i able deploy app in debug mode , app builds no errors.i trying publish apk in release mode getting below error.i have used syncfusion sfchart , sfgauge.kindly , find below error description:
c:\program files (x86)\msbuild\xamarin\android\xamarin.android.common.targets(5,5): error msb4018: "linkassemblies" task failed unexpectedly. xamarin.android.xamarinandroidexception: error xa2006: reference metadata item 'system.int32 xamarin.forms.platform.android.resource/attribute::actionbarsize' (defined in 'syncfusion.sfgauge.xforms.android, version=14.2451.0.26, culture=neutral, publickeytoken=null') 'syncfusion.sfgauge.xforms.android, version=14.2451.0.26, culture=neutral, publickeytoken=null' not resolved. ---> mono.cecil.resolutionexception: failed resolve system.int32 xamarin.forms.platform.android.resource/attribute::actionbarsize @ mono.linker.steps.markstep.markfield(fieldreference reference) @ mono.linker.steps.markstep.markinstruction(instruction instruction) @ mono.linker.steps.markstep.markmethodbody(methodbody body) @ mono.linker.steps.markstep.processmethod(methoddefinition method) @ mono.linker.steps.markstep.processqueue() @ mono.linker.steps.markstep.process() @ mono.linker.steps.markstep.process(linkcontext context) @ mono.linker.pipeline.process(linkcontext context) @ monodroid.tuner.linker.process(linkeroptions options, linkcontext& context) @ xamarin.android.tasks.linkassemblies.execute() --- end of inner exception stack trace --- @ xamarin.android.diagnostic.error(int32 code, exception innerexception, string message, object[] args) @ xamarin.android.tasks.linkassemblies.execute() @ microsoft.build.backend.taskexecutionhost.microsoft.build.backend.itaskexecutionhost.execute() @ microsoft.build.backend.taskbuilder.d__26.movenext() (msb4018) (ewsmobile.droid)
your main issue following:
error xa2006: reference metadata item 'system.int32 xamarin.forms.platform.android.resource/attribute::actionbarsize' (defined in 'syncfusion.sfgauge.xforms.android, version=14.2451.0.26, culture=neutral, publickeytoken=null') 'syncfusion.sfgauge.xforms.android, version=14.2451.0.26, culture=neutral, publickeytoken=null' not resolved. ---> mono.cecil.resolutionexception: failed resolve system.int32 xamarin.forms.platform.android.resource/attribute::actionbarsize
this means attribute
actionbarsize
cannot found or not included in resource.designer.cs
file. there few typical issues of why happens:
1) not compiling against latest android api (api 23 @ current time of writing)
2) referenced library might out of date , should updated , compiled against latest android api. (api 23 currently)
3) if using xamarin.forms, should ensure use version compiled third party library.
https://developer.android.com/reference/android/r.attr.html#actionbarsize
as additional debugging steps:
1) set linker setting in release
configuration don't link/none
.
https://developer.xamarin.com/guides/android/advanced_topics/linking/#linker_behavior
if works here, know type being linked out of library.
2) preserve linked out type
you can use linkskip
linkskip assembly:
https://developer.xamarin.com/guides/android/advanced_topics/linking/#linkskip
otherwise can readup on general linking
here:
https://developer.xamarin.com/guides/android/advanced_topics/linking
Comments
Post a Comment