Forum Xamarin.Android

Switching from Debug to Release - linker error and/or Action<T> error.

NicWiseNicWise NZMember, Insider, Beta mod
edited October 2012 in Xamarin.Android

Hi there

I'm trying to get my app out to someone. I switched the solution over to Release, but I'm getting a linker error:

/Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.Common.targets: error : Error executing task LinkAssemblies: Failed to resolve System.Boolean System.Type::op_Equality(System.Type,System.Type)

This normally tells me that I have a full framework assembly where I should have a MfA one. But all of the ones I'm using are MfA, I think.

I checked the framework version, and all but one are set to "Android 4.0.3 ICS". The other one is set to "Android 2.2 (FroYo)". If I change that one to ICS, I get a lot of compiler errors all over the place, most around Action not existing anymore (I'd have to use Action).

Any idea what is going on? I wouldn't have thought that the Android version would have dictated anything about the .NET version.

I have:

The main project. (ICS)
ActionbarSherlock (ICS)
RestSharp.MonoDroid.dll (ICS, I recompiled it)
My API (uses restsharp) - FroYo, but if I change to ICS I get the Action issues
System, System.Core, System.Web.Services (2.0.5?)

Debug works fine, it's just when I want to embed the mono framework it throws issues.




  • JoeJoe AUMember
    edited October 2012

    If you go to your project properties and open the Mono Android Options tab, there's a dropdown for Linking.

    If you change it to None, this should get you over the hump, but it's only a temporary solution.

    What really needs to happen is to work out what the linker is leaving out (or why) - sometimes you can explicitly include classes that it might be omitting.

    There's more about linking here.

  • WMeintsWMeints NLMember, Insider

    Hmm, System.Type::op_Equality. This should be linked correctly automatically. Normally when this happens you have a library that doesn't tell the linker that the missing member should be preserved with a [Preserve] attribute. But System.Type is in the mscorlib library, which should work correctly.

    I think this one is an interesting case for the Xamarin devs :-)

  • NicWiseNicWise NZMember, Insider, Beta mod

    I worked it out in the end. I had created the MfA .csproj from a full framework one, and I thought I'd renamed all the GUID's in the right places.

    It appears I didn't.

    So I made a new Android Library, copied it into the right place, added the files in, and now it all works.

    Thanks for the help everyone.

    BTW, this error on iOS means you have a full-framework DLL in your project, which I suspect is what was happening here. Portable Lib's can't come soon enough (or some other solution)

Sign In or Register to comment.