Android + WCF - Debug mode it works fine, but Release mode doesn't works anymore

I have to use a WCF service that I've made to get some information from the server. When I run the Android Application on the Debug mode it works fine, but when I change to Release mode it doesn't works anymore.

Do you have any idea of what can I do to solve it?

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    It might be the linker stripping out too much code, but it is hard to tell from the information you have provided. Add some more information, such as the stack trace that you get or logcat then it will be a lot easier to help you.

  • NealCulinerNealCuliner USBeta ✭✭✭

    I reported this issue to bugzilla a month or two (or more) ago. We had this issue in the past, fixed, now it's back. You'll have to exclude from linking System.ServiceModel;System.Web.Services I think it is. See if you can find my report in bugzilla.

  • Daniel.6548Daniel.6548 USMember

    thank you,
    I will test and notice if it worked.

  • Daniel.6548Daniel.6548 USMember
    edited May 2014

    Follow bellow the Exception message and the StackTrace:

    Object reference not set to an instance of an object
     at System.ServiceModel.MonoInternal.ClientRuntimeChannel..ctor (System.ServiceModel.Dispatcher.ClientRuntime runtime, System.ServiceModel.Description.ContractDescription contract, TimeSpan openTimeout, TimeSpan closeTimeout, IChannel contextChannel, IChannelFactory factory, System.ServiceModel.Channels.MessageVersion messageVersion, System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) [0x00000] in <filename unknown>:0 
     at System.ServiceModel.MonoInternal.ClientRuntimeChannel..ctor (System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.ChannelFactory channelFactory, System.ServiceModel.EndpointAddress remoteAddress, System.Uri via) [0x00000] in <filename unknown>:0 
     at System.ServiceModel.ChannelFactory`1[IManager].CreateChannel (System.ServiceModel.EndpointAddress address, System.Uri via) [0x00000] in <filename unknown>:0 
     at System.ServiceModel.ChannelFactory`1[IManager].CreateChannel (System.ServiceModel.EndpointAddress address) [0x00000] in <filename unknown>:0 
     at System.ServiceModel.ChannelFactory`1[IManager].CreateChannel () [0x00000] in <filename unknown>:0 
     at System.ServiceModel.ClientBase`1[IManager].CreateChannel () [0x00000] in <filename unknown>:0 
     at System.ServiceModel.ClientBase`1[IManager].get_InnerChannel () [0x00000] in <filename unknown>:0 
     at System.ServiceModel.ClientBase`1[IManager].Open () [0x00000] in <filename unknown>:0 
     at wevo.balloonews.Service.ServiceDal.validaUsuario (System.String user, System.String password) [0x00000] in <filename unknown>:0
    
  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    Can you explain the process you took to get to where you are now with your WCF Service? I've done this in the past and haven't ran into this issue at all. I just made sure to use SLSvcUtil.exe to generate my proxy and then doing a full published/signed .APK to release to clients.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    The problem here is that the linker is removing a CreateChannel() method that the ClientRuntimeChannel() constructor tries to call via reflection. A patch that allows the linker to avoid this problem has been committed, but not yet been released [1].

    [1] https://bugzilla.xamarin.com/show_bug.cgi?id=19411#c3

    For the time being, you can solve the error by following the instructions for adding a linker description file here:
    http://forums.xamarin.com/discussion/comment/46725/#Comment_46725

Sign In or Register to comment.