Xamarin Android Release Build Error

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Xamarin Android Release Build Error

venkatesh
Hi ,

we are developing an business application using Xamarin Android.
We have used user assemblies (java binding library for Pull to Refresh component) and   Newtonsoft.Json  from Nuget Packages . These assemblies are referenced in our android project.

It is working fine with Debug mode, when we change to Release mode it shows the error as You need to add a reference to Mono.Android.Export.dll when you use ExportAttribute or ExportFieldAttribute..

we have referenced the Mono.Android.Export.dll but shows error in release mode alone.

Note:

I have done the following in Android Project Properties for Release build
  Mono Android Options -> Configuration -> Release
                                    Linking -> Sdk and User Assemblies
                                    Bundle assemblies into native code enabled.

Kindly find the attached diagnostics build log file for your reference and help me to resolve the issue.

Thanks in advance.

ReleaseError.jpg
DignosticsBuild.zip
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

venkatesh
Hi,

Kindly suggest on this issue as we are struggling this issue past two days for release build.


Thanks

Venkatesh.R
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

Gusman
Ok, thanks for the update.



2014-04-09 11:02 GMT+02:00 venkatesh <[hidden email]>:
Hi,

Kindly suggest on this issue as we are struggling this issue past two days
for release build.


Thanks

Venkatesh.R



--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/Xamarin-Android-Release-Build-Error-tp5713691p5713692.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

venkatesh
Hi,

Could you please guide me on how to solve the above issue.



Thanks

Venkatesh.R
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

venkatesh
Hi,

No one facing this kind of issue in Release build.
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

Gusman
Hi.

One difference between release and debug is the target architecture, in release by default x86 is removed, did you try to add x86 architecture to release build?

It's a long shot, if you have a dll compiled for x86 with explĂ­cit reference set to an x86 library maybe this causes the error.

Also, try to instead of use the json library from sourcecode  to download it from xamarin component page: https://components.xamarin.com/view/json.net

Cheers.
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

venkatesh
Hi,

 > in release by default x86 is removed, did you try to add x86 architecture to release build?

Yes. I have tried to set both armeabi-v7 and x86  architecture with sdk and user assemblies .
But it gives same error saying that error  "XA4210: You need to add a reference to Mono.Android.Export.dll when you use ExportAttribute or ExportFieldAttribute "

 If i build with sdk assemblies only then build successful in release mode.

But size of the application varies in release build for sdk assemblies only  .

Debug Build   : 4.0 MB
Release Build :  10.3 MB.

Kindly suggest me on this.
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

Jonathan Pryor-2
In reply to this post by venkatesh
Sorry for the delay...

On Apr 8, 2014, at 2:04 AM, venkatesh <[hidden email]> wrote:
> It is working fine with Debug mode, when we change to Release mode it shows the error as
> *You need to add a reference to Mono.Android.Export.dll when you use ExportAttribute or ExportFieldAttribute.*.
...
> <http://mono-for-android.1047100.n5.nabble.com/file/n5713691/DignosticsBuild.zip>

The relevant line in DignosticsBuild.txt is:

2>AndroidLinkMode = Full

i.e. $(AndroidLinkMode) is Full, affectionately known as "please break my code."

You're hitting: https://bugzilla.xamarin.com/show_bug.cgi?id=15022

(which may have been verified incorrectly, as it fails for me with Xamarin.Android 4.12.3, which it was supposedly verified with.)

Please try setting $(AndroidLinkMode) to SdkOnly, i.e. "Link SDK Assemblies Only".

Thanks,
 - Jon

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

venkatesh
Hi Jon,


Thanks for your prompt reply.  Setting to "Link SDK Assemblies Only" solved the above issue.



Thanks,

Venkatesh.R
Reply | Threaded
Open this post in threaded view
|

Re: Xamarin Android Release Build Error

sarahzohar88
This post has NOT been accepted by the mailing list yet.
Thanks because, i want to this type of reply.