I have a WCF service stub placed in a PCL library project used in an Android app I'm developing. It works fine in debug mode. I can call the WCF service just fine. It also works just fine in the iOS version of the app (both debug and release). However, when I try to call the WCF service in Android while in release mode it throws exceptions. The only info I have found on the Internet is to check that Internet permissions are set for the app. They are. Has anyone else run into this?
StackTrace:
[MonoDroid] UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
[MonoDroid] at System.ServiceModel.MonoInternal.ClientRuntimeChannel..ctor (System.ServiceModel.Dispatcher.ClientRuntime,System.ServiceModel.Description.ContractDescription,System.TimeSpan,System.TimeSpan,System.ServiceModel.Channels.IChannel,System.ServiceModel.Channels.IChannelFactory,System.ServiceModel.Channels.MessageVersion,System.ServiceModel.EndpointAddress,System.Uri) <0x00508>
[MonoDroid] at System.ServiceModel.MonoInternal.ClientRuntimeChannel..ctor (System.ServiceModel.Description.ServiceEndpoint,System.ServiceModel.ChannelFactory,System.ServiceModel.EndpointAddress,System.Uri) <0x000ef>
[MonoDroid] at System.ServiceModel.ClientBase1/ChannelBase
1<ITraderService, ITraderService>.get_Inner () <0x0007f>
[MonoDroid] at System.ServiceModel.ClientBase1/ChannelBase
1<ITraderService, ITraderService>.BeginInvoke (string,object[],System.AsyncCallback,object) <0x0006f>
[MonoDroid] at TraderServiceClient/TraderServiceClientChannel.BeginRegisterAssociationDevice (string,string,string,System.AsyncCallback,object) <0x000b7>
[MonoDroid] at TraderServiceClient.ITraderService.BeginRegisterAssociationDevice (string,string,string,System.AsyncCallback,object) <0x0006b>
[MonoDroid] at TraderServiceClient.OnBeginRegisterAssociationDevice (object[],System.AsyncCallback,object) <0x0010f>
[MonoDroid] at System.ServiceModel.ClientBase1<ITraderService>.InvokeAsync (System.ServiceModel.ClientBase
1/BeginOperationDelegate,object[],System.ServiceModel.ClientBase
1/EndOperationDelegate<ITraderService>,System.Threading.SendOrPostCallback,object) <0x001a7>
[MonoDroid] at TraderServiceClient.RegisterAssociationDeviceAsync (string,string,string,object) <0x002bf>
[MonoDroid] at TraderServiceClient.RegisterAssociationDeviceAsync (string,string,string) <0x00037>
[MonoDroid] at FireSync.Droid.ProfileSetupActivity.<OnCreate>m__A3 (object,System.EventArgs) <0x0032b>
[MonoDroid] at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View) <0x0003f>
[MonoDroid] at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) <0x0005f>
[MonoDroid] at (wrapper dynamic-method) object.d01e83f4-3eee-42e6-99f6-88a759c0224c (intptr,intptr,intptr) <0x00043>
[mono]
[mono] Unhandled Exception:
[mono] System.NullReferenceException: Object reference not set to an instance of an object
[mono] 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
[mono] 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
[mono] at System.ServiceModel.ClientBase
1+ChannelBase1[ITraderService,ITraderService].get_Inner () [0x00000] in <filename unknown>:0
[mono] at System.ServiceModel.ClientBase
1+ChannelBase1[ITraderService,ITr
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
[mono-rt] 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
[mono-rt] 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
[mono-rt] at System.ServiceModel.ClientBase
1+ChannelBase1[ITraderService,ITraderService].get_Inner () [0x00000] in <filename unknown>:0
[mono-rt] at System.ServiceModel.ClientBase
1+ChannelBase`1[ITrad
Xamarin Development Environment:
Xamarin Studio Version 4.2.3 (build 59) Runtime: Mono 3.2.6 ((no/9b58377) GTK+ 2.24.23 theme: Raleigh GTK# (2.12.0.0) Package version: 302060000
Apple Developer Tools Xcode 5.0.2 (3335.32) Build 5A3005
Xamarin.iOS Version: 7.0.7.2 (Business Edition) Hash: fb4bc7b Branch: Build date: 2014-17-02 17:43:23-0500
Xamarin.Mac Xamarin.Mac: 1.6.27
Xamarin.Android Version: 4.12.1 (Business Edition) Android SDK: /Developer/android-sdk-macosx Supported Android versions: 2.1 (API level 7) 2.2 (API level 8) 2.3 (API level 10) 3.1 (API level 12) 4.0 (API level 14) 4.0.3 (API level 15) 4.2 (API level 17) 4.3 (API level 18) 4.4 (API level 19) Java SDK: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)