Consuming WCF service in Xamarin Forms - c#

I am wishing to connect to a WCF service (running on a Windows PC) via Xamarin Form based on this sample code.
I successfully managed to find and create the Connected Service pointing to the WCF. and I followed the same approach that I earlier used in the UWP environment.
But once I call any of the methods exposed in the service I get this exception in the Android environment.
The method or operation is not implemented
I don't use PCL style but .net way.
here is the stack trace of the exception.
at System.ServiceModel.Channels.BindingContext.BuildInnerChannelFactory[TChannel] () [0x00007] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/BindingContext.cs:149
at System.ServiceModel.Channels.BindingElement.BuildChannelFactory[TChannel] (System.ServiceModel.Channels.BindingContext context) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/BindingElement.cs:52
at System.ServiceModel.Channels.BinaryMessageEncodingBindingElement.BuildChannelFactory[TChannel] (System.ServiceModel.Channels.BindingContext context) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/BinaryMessageEncodingBindingElement.cs:94
at System.ServiceModel.Channels.BindingContext.BuildInnerChannelFactory[TChannel] () [0x00007] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/BindingContext.cs:149
at System.ServiceModel.Channels.Binding.BuildChannelFactory[TChannel] (System.ServiceModel.Channels.BindingParameterCollection parameters) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Binding.cs:133
at System.ServiceModel.ChannelFactory.CreateFactory () [0x000be] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory.cs:202
at System.ServiceModel.ChannelFactory.OnOpening () [0x00006] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory.cs:383
at System.ServiceModel.Channels.CommunicationObject.ProcessOpening () [0x00017] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:276
at System.ServiceModel.Channels.CommunicationObject.Open (System.TimeSpan timeout) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:169
at System.ServiceModel.Channels.CommunicationObject.Open () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel.Channels/CommunicationObject.cs:164
at System.ServiceModel.ChannelFactory.EnsureOpened () [0x0004c] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory.cs:297
at System.ServiceModel.ChannelFactory`1[TChannel].CreateChannel () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel/ChannelFactory_1.cs:108
at System.ServiceModel.DuplexClientBase`1[TChannel].CreateChannel () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel/DuplexClientBase.cs:123
at System.ServiceModel.ClientBase`1[TChannel].get_InnerChannel () [0x00008] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel/ClientBase.cs:186
at System.ServiceModel.ClientBase`1[TChannel].get_Channel () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/System.ServiceModel/System.ServiceModel/ClientBase.cs:192
at AppMobileService.AppMobileCommandHandlerClientBase.SubscribeAsync (System.String name, AppMobileService.AppMobileConnectionType connectionType) [0x00001] in C:\Users\adm\Desktop\AppMobilePortable\AppMobilePortable\AppMobilePortable\Connected Services\AppMobileService\Reference.cs:945
at PortableAppMobile.Services.AppMobileClientService.Connect () [0x00024] in C:\Users\adm\Desktop\AppMobilePortable\AppMobilePortable\AppMobilePortable\Service\AppMobileClientService.cs:136 ```

Related

Xamarin.IOS MvvmCross App throws NullReference Exception in ViewDidLoad method in iOS9

I am working on an existing Xamarin iOS application with a PCL and uses MvvmCross for IoC and Databinding. Built on MvvmCross 3.1.1
The App looks like a TabControl App but it is buttons on the MainViewCotnroller giving the Tab feel to it. Views are declared in the Storyboard and in the MainViewController,
PrepareForSegue(UIStoryboardSegue segue, NSObject sender) method
is overridden to load the selected "Tab" View based on the Segue selected - like below
if (segue.Identifier == "FirstSegue")
{
var dest = segue.DestinationViewController as FirstView;
dest.Request = new MvxViewModelRequest<FirstViewModel>(null, null, new MvxRequestedBy());
foreach (UIView v in src.placeHolderView.Subviews)
{
v.RemoveFromSuperview();
}
dest.View.Frame = new CGRect(0f, 0f, w, h);
src.placeHolderView.Add(dest.View);
}
The App runs fine on iPhones with iOS 7.1 till 8.4.
Just before iOS 9 was released I did a test installation for the App on iPhone 6 with iOS 9.1 beta and the App crashed on loading. I retrieved the device logs (below) and analysed that the problem is in the guts of the MvvmCross ViewDidLoad method. I updated the latest SDKs (XCode 7, Xamarin.IOS 9.0) and followed instructions provided by Xamarin and compiled the App again using the latest SDKs same error. Updated the Nuget package reference for MvvmCross to 3.5.1 and still the same issue
The issues is there is a null reference at Line 44 in the 3.5 MvvMCross Source Code in GitHub
Note: This piece of code has not changed since 3.1 at least and 3.5.1 is the latest in the nuget for MvvmCross
Stack Trace below (App Names, Project Names changed for security reasons):
2015-09-21 11:06:26.991 MyApp[1210:60b] Unhandled managed exception:
Object reference not set to an instance of an object (System.NullReferenceException)
at Cirrious.CrossCore.Mvx.Resolve[IMvxViewModelLoader] () [0x00006] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.LoadViewModel (IMvxTouchView touchView) [0x00057] in <filename unknown>:0
at Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCreate (IMvxView view, System.Func`1 viewModelLoader) [0x00012] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.OnViewCreate (IMvxTouchView touchView) [0x00001] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerAdapter.HandleViewDidLoadCalled (System.Object sender, System.EventArgs e) [0x00007] in <filename unknown>:0
at (wrapper delegate-invoke) <Module>:invoke_void_object_EventArgs (object,System.EventArgs)
at Cirrious.CrossCore.Core.MvxDelegateExtensionMethods.Raise (System.EventH
andler eventHandler, System.Object sender) [0x00004] in <filename unknown>:0
at Cirrious.CrossCore.Touch.Views.MvxEventSourceTableViewController.ViewDidLoad () [0x00006] in <filename unknown>:0
at MyProject.Touch.MostPurchasedView.ViewDidLoad () [0x00048] in d:\Working\Repo\MyApp\<MyProjectName>\MyProject.Touch\Views\OneOfTheView.cs:31
at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper (intptr,intptr)
at UIKit.UIViewController.get_View () [0x00030] in /Users/builder/data/lanes/2077/d230615b/source/maccore/src/build/ios/native/UIKit/UIViewController.g.cs:2632
at MyProject.Touch.HomeViewController.PrepareForSegue (UIKit.UIStoryboardSegue segue, Foundation.NSObject sender) [0x0016a] in d:\Working\Repo\MyApp\MyProject.Mobile\MyProject.Touch\HomeViewController.cs:335
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at
UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2077/d230615b/source/maccore/src/UIKit/UIApplication.cs:74
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0001c] in /Users/builder/data/lanes/2077/d230615b/source/maccore/src/UIKit/UIApplication.cs:57
at MyProject.Touch.Application.Main (System.String[] args) [0x00001] in d:\Working\Repo\MyApp\MyProject.Mobile\MyProject.Touch\Main.cs:16
2015-09-21 11:06:26.994 MyApp[1210:60b] critical: Stacktrace:
Native stacktrace:
.....
I tried the above with just calling the below in the View.cs:
public override void ViewDidLoad()
{
try
{
base.ViewDidLoad();
}
catch (Exception ex)
{
// throw a toast msg in the UI
}
}
I disabled all the base.ViewDidLoad() in all the View.cs files in the ViewDidLoad override methods to take it to the next level and the same problem but inside the constructor of MvxSimpleTableViewSource class
Device Log below:
Object reference not set to an instance of an object (System.NullReferenceException)
at Cirrious.CrossCore.Mvx.TryResolve[IMvxTouchSystem] (IMvxTouchSystem& service) [0x00006] in <filename unknown>:0
at Cirrious.CrossCore.Touch.Platform.MvxIosMajorVersionChecker.ReadIsIosVersionOrHigher (Int32 target, Boolean defaultValue) [0x00000] in <filename unknown>:0
at Cirrious.CrossCore.Touch.Platform.MvxIosMajorVersionChecker..ctor (Int32 major, Boolean defaultValue) [0x00006] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Touch.Views.MvxSimpleTableViewSource..ctor (UIKit.UITableView tableView, System.String nibName, System.String cellIdentifier, Foundation.NSBundle bundle) [0x00000] in <filename unknown>:0
at MyProject.Touch.MostPurchasedView.ViewDidLoad () [0x00059] in d:\Working\Repo\MyApp\MyProject.Mobile\MyProject.Touch\Views\OneOfTheView.cs:42
at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper (intptr,intptr)
at UIKit.UIViewController.get_View () [0x00030] in /Users/builder/data/lanes/2077/d230615b/source/maccore/src/build/ios/native/UIKit/UIViewController.g.cs:2632
at MyProject.Touch.HomeViewController.PrepareForSegue (UIKit.UIStoryboardSegue segue, Foundation.NSObject sender) [0x0016a] in d:\Working\Repo\MyApp\MyProject.Mobile\MyProject.Touch\HomeViewController.cs:343
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2077/d230615b/source/maccore/src/UIKit/UIApplication.cs:74
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0001c] in /Users/builder/data/lanes/2077/d230615b/source/maccore/src/UIKit/UIApplication.cs:57
at MyProject.Touch.Application.Main (System.String[] args) [0x00001] in d:\Working\Repo\MyApp\MyProject.Mobile\MyProject.Touch\Main.cs:16
In short :
Only in iOS 9.1, MvvmCross 3.1.1 AND MvvmCross 3.5.1 has a NullReference Issue in line 44 of the MvxViewControllerExtensionMethods class which gets called during ViewDidLoad but works well with iOS 8.4 and below
I am just getting familiar with MvvmCross framework and unsure whether it is an issue with MvvmCross and iOS 9.
Has anyone come across this issue? Any help on this would be appreciated.
Note: The MvvmCross samples work fine with iOS9. So I believe it has to be something with the Tab implementation.
One thing is that MvvmCross 3.1.1 not is build for iOS unified code. This will prevent you from submitting your app. MvvmCross 4.0 is currently in beta, but i would recommend using it, because it has many fixes.
If the code crashes on line 44 while trying to resolve IMvxViewModelLoader, it probably means that you are missing some package where the IMvxViewModelLoader is.

App crashes in release mode and not in debug mode - Xamarin Forms

I am building a cross platform app and i want to release it to testers, but it doesn't work when i am deploying it in release mode. As far as exceptions go i do not get any. As stated in the question it works in debug mode. The app just goes to splashscreen and crashes. I ran the original app through test fairy and got this exception:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
... 2 more
Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.IO.FileNotFoundException: Could not load file or assembly '<Censored: Name of forms class library>.dll' or one of its dependencies. The system cannot find the file specified.
File name: '<Censored: Name of forms class library>.dll'
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00000] in :0
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
at Xamarin.Forms.Xaml.XamlParser.GetElementType (Xamarin.Forms.Xaml.XmlType xmlType, IXmlLineInfo xmlInfo, System.Reflection.Assembly currentAssembly, Xamarin.Forms.Xaml.XamlParseException& exception) [0x00000] in :0
at (wrapper delegate-invoke) :invoke_Type_XmlType_IXmlLineInfo_Assembly_XamlParseException& (Xamarin.Forms.Xaml.XmlType,System.Xml.IXmlLineInfo,System.Reflection.Assembly,Xamarin.Forms.Xaml.XamlParseException&)
at Xamarin.Forms.Xaml.XamlTypeResolver.Resolve (System.String qualifiedTypeName, IServiceProvider serviceProvider, Xamarin.Forms.Xaml.XamlParseException& exception) [0x00000] in :0
at Xamarin.Forms.Xaml.XamlTypeResolver.TryResolve (System.String qualifiedTypeName, System.Type& type) [0x00000] in :0
at Xamarin.Forms.Xaml.ExpandMarkupsVisitor+MarkupExpansionParser.Parse (System.String match, System.String& remaining, IServiceProvider serviceProvider) [0x00000] in :0
at Xamarin.Forms.Xaml.ExpandMarkupsVisitor.ParseExpression (System.String& expression, IXmlNamespaceResolver nsResolver, IXmlLineInfo xmlLineInfo, INode node, INode parentNode) [0x00000] in :0
at Xamarin.Forms.Xaml.ExpandMarkupsVisitor.Visit (Xamarin.Forms.Xaml.MarkupNode markupnode, INode parentNode) [0x00000] in :0
at Xamarin.Forms.Xaml.MarkupNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00000] in :0
at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00000] in :0
at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00000] in :0
at Xamarin.Forms.Xaml.RootNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00000] in :0
at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.String xaml) [0x00000] in :0
at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x00000] in :0
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[LoginPage] (<Censored>.Login.LoginPage view, System.Type callingType) [0x00000] in :0
at <Censored>.Login.LoginPage.InitializeComponent () [0x00000] in :0
at <Censored>.Login.LoginPage..ctor () [0x00000] in :0
at <Censored>.App.b__0 () [0x00000] in :0
at <Censored>.ViewFactory.Resolve[LoginViewModel] (<Censored>.Login.LoginViewModel viewModel) [0x00000] in :0
at <Censored>.App..ctor () [0x00000] in :0
at md5b406f03a919343acc4f3b337a44e1248.MainActivity.n_onCreate(Native Method)
at md5b406f03a919343acc4f3b337a44e1248.MainActivity.onCreate(MainActivity.java:28)
at android.app.Activity.performCreate(Activity.java:5458)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)
at android.app.ActivityThread.access$900(ActivityThread.java:174)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5593)
... 5 more
I cannot show you the source code, but i have reproduced the error in a new test solution.
Here is a link to the repository with the test project. It is just a project using MVVM with Xamarin Forms.
Fixed it by manually deleting all obj folders and all bin folders in the entire solution.
Edit: Came back again and now this fix does not work!
If your solution works in Debug mode, but not in Release mode, it might be an issue with the Linker.
Right Click on your specific project (not Solution) -> Android Options -> Linker -> Choose "None" in Linking. This will include all dlls in the Release Library.

Google Play Games Services can't register class (Unity)

I use GPGS for Unity (this)
When I launch my app on phone i have this (and no activity from plugin):
D/GamesUnitySDK(12145): Performing Android initialization of the GPG SDK
E/GamesNativeSDK(12145): Can't register class com/google/android/gms/nearby/Nearby: an exception occurred.
E/GamesNativeSDK(12145): Can't register class com/google/android/gms/nearby/connection/AppIdentifier: an exception occurred.
E/GamesNativeSDK(12145): Can't register class com/google/android/gms/nearby/connection/AppMetadata: an exception occurred.
E/GamesNativeSDK(12145): Can't register class com/google/android/gms/nearby/connection/Connections: an exception occurred.
E/GamesNativeSDK(12145): Can't register class com/google/android/gms/nearby/connection/Connections$StartAdvertisingResult: an exception occurred.
I/Unity (12145): InvalidOperationException: There was an error creating a GameServices object. Check for log errors from GamesNativeSDK
I/Unity (12145): at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Build (GooglePlayGames.Native.PInvoke.PlatformConfiguration configRef) [0x00000] in <filename unknown>:0
I/Unity (12145): at GooglePlayGames.Native.NativeClient.InitializeGameServices () [0x00000] in <filename unknown>:0
I/Unity (12145): at GooglePlayGames.Native.NativeClient.Authenticate (System.Action 1 callback, Boolean silent) [0x00000] in <filename unknown>:0
I/Unity (12145): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action 1 callback, Boolean silent) [0x00000] in <filename unknown>:0
I/Unity (12145): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action 1 callback) [0x00000] in <filename unknown>:0
I/Unity (12145): at GooglePlayGames.PlayGamesLocalUser.Authenticate (System.Action`1 callback) [0x00000] in <filename unknown>:0
I/Unity (12145): at GooglePlayServiceController.Login () [0x00000] in <filename unknown>:0
I/Unity (12145): at GooglePlayServiceController.Start () [0x00000] in <filename unknown
For Init use thin in Awake:
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.EnableSavedGames()
.WithInvitationDelegate((invitation, shouldAutoAccept) => {})
.WithMatchDelegate((match, shouldAutoLaunch) => {})
.Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
And this in Start for login:
Social.localUser.Authenticate((bool success) =>
{
});
In google I find some actions to resolve this problem but it doesn't work (last version plugin, last version android sdk, my account is tester in Developer Console).
Someone can help me with this problem?
Happened the same to me and after reading this thread (https://github.com/playgameservices/play-games-plugin-for-unity/issues/506) the solution was:
Update the Android SDK Google Play Services package to a version >=r23 (under the extras category)
Go to Window | Google Play Games | Setup | Android Setup... and click on Setup (this will update the local copy of the library)
Rebuild
Be very careful if you are also using Google Play Games for Unity plugin because you may encounter this problem:
https://github.com/googleanalytics/google-analytics-plugin-for-unity/issues/51

ExecutionEngineException - Error at iOS Runtime with parse.com SDK

We're creating a game for iOS and android using Unity3d (version 5.0.1p1), and since we are using Parse.com data services we naturally went with it to implement the remote push notifications.
The problem is that after building the game and running it on a test device (iPhone 4s iOS8.1.2) we get at game start an execution engine exception that we cant figure out. Here is the exception :
ExecutionEngineException: Attempting to call method
'System.Reflection.MonoProperty::StaticGetterAdapterFrame' for which no ahead of time (AOT) code was
generated.
at System.Reflection.EventInfo+AddEventAdapter.Invoke (System.Object
_this, System.Delegate dele)
[0x00000] in <filename unknown>:0
at System.Reflection.MonoProperty+GetterAdapter.Invoke (System.Object
_this) [0x00000] in <filename
unknown>:0
at AOGenerator.BlurBuffer () [0x00000] in <filename unknown>:0
at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in
<filename unknown>:0
at Newtonsoft.Json.Bson.BsonRegex.get_Type () [0x00000] in <filename unknown>:0
at Parse.ParseInstallation.get_Badge () [0x00000] in <filename unknown>:0
at Parse.ParseInstallation.SetPlatformAutomaticValue () [0x00000] in <filename unknown>:0
at Parse.ParseInstallation.SetAutomaticValues () [0x00000] in <filename unknown>:0
at Parse.ParseInstallation.SaveAsync (System.Threading.Tasks.Task toAwait, CancellationToken
cancellationToken) [0x00000] in <filename unknown>:0
at Parse.PlatformHooks+<>c__DisplayClass38.<RequestAsync>b__33 (System.Threading.Tasks.Task`1 _)
[0x00000] in <filename unknown>:0
at Parse.ParseObject+<>c__DisplayClass18.<SaveAsync>b__17 (System.Threading.Tasks.Task toAwait)
[0x00000] in <filename unknown>:0
at FlurryAnalyticsIOS.SetSessionTimeout (Int32 seconds) [0x00000] in <filename unknown>:0
at
System.Collections.Generic.Dictionary`2[System.Int64,System.Boolean].Do_ICollectionCopyTo[KeyValuePair`2]
(System.Array array, Int32 index, System.Collections.Generic.Transform`1 transform) [0x00000] in <filename
unknown>:0
at Parse.Internal.TaskQueue.Enqueue[Task] (System.Func`2 taskStart, CancellationToken cancellationToken)
[0x00000] in <filename unknown>:0
at Parse.ParseObject.SaveAsync (CancellationToken cancellationToken) [0x00000] in <filename unknown>:0
at Parse.ParseObject.SaveAsync () [0x00000] in <filename unknown>:0
at Parse.ParseInitializeBehaviour.<Awake>b__0 (System.Byte[] deviceToken) [0x00000] in <filename
unknown>:0
at FlurryAnalyticsIOS.SetSessionTimeout (Int32 seconds) [0x00000] in <filename unknown>:0
at Newtonsoft.Json.Bson.BsonRegex.get_Type () [0x00000] in <filename unknown>:0
at Parse.PlatformHooks+<>c__DisplayClass24.<RegisterDeviceTokenRequest>b__22 () [0x00000] in
<filename unknown>:0
at System.Action.Invoke () [0x00000] in <filename unknown>:0
at Newtonsoft.Json.Bson.BsonRegex.get_Type () [0x00000] in <filename unknown>:0
at Parse.PlatformHooks+<RunDispatcher>d__44.MoveNext () [0x00000] in <filename unknown>:0
at System.Nullable`1[System.DateTimeOffset].ToString () [0x00000] in <filename unknown>:0
System.Nullable`1:ToString()
UnityEngine.Debug:Internal_LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Parse.<RunDispatcher>d__44:MoveNext()
System.Nullable`1:ToString()
The problem just appeared with the new Unity Parse SDK 1.5 (which contains the PNS feature). What we know is that running an empty project with just the parse sdk goes fine and the notifications work just fine, but in our actual project, because of the exception, devices dont register for the notifications in parse, so we are assuming there is a kind of a conflict between parse and one of the other tools we are using.
FYI : We are building the game using IL2CPP for a universal architecture (we re also building with .Net 2.0 subset, but I dont think that this has something to do with the problem).
Thank you for your time and for your answers.
UPDATE ::
We tried to build using Mono(2.x) this time and we have pretty much the same exception that turned into this :
ExecutionEngineException: Attempting to JIT compile method
'System.Reflection.MonoProperty:StaticGetterAdapterFrame
(System.Reflection.MonoProperty/StaticGetter`1,object)' while
running with ­­aot­only.
at System.Reflection.MonoProperty.GetValue (System.Object obj,
System.Object[] index)
[0x00000] in :0
at Parse.ParseInstallation.get_Badge () [0x00000] in :0
at Parse.ParseInstallation.SetPlatformAutomaticValue () [0x00000] in
unknown>:0
at Parse.ParseInstallation.SetAutomaticValues () [0x00000] in
:0
at Parse.ParseInstallation.SaveAsync (System.Threading.Tasks.Task
toAwait,
CancellationToken cancellationToken) [0x00000] in :0
at Parse.ParseObject+<>c__DisplayClass18.b__17
(System.Threading.Tasks.Task toAwait) [0x00000] in :0
at Parse.Internal.TaskQueue.Enqueue[Task] (System.Func`2 taskStart,
CancellationToken
cancellationToken) [0x00000] in :0
at Parse.ParseObject.SaveAsync (CancellationToken cancellationToken)
[0x00000] in
:0
at Parse.ParseObject.SaveAsync () [0x00000] in :0
at Parse.ParseInitializeBehaviour.b__0 (System.Byte[]
deviceToken) [0x00000] in
:0
at
Parse.PlatformHooks+<>c__DisplayClass24.b__22
()
[0x00000] in :0
at Parse.PlatformHooks+d__44.MoveNext () [0x00000] in
unknown>:0
UnityEngine.Debug:Internal_LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Parse.d__44:MoveNext()
Hopes it bring you guys more details about the problem.
Update 2 ::
We know exactly what causes the exception to happen and unfortunately we have no control over it, its when we register for notification, we do it this way :
using NotificationServices = UnityEngine.iOS.NotificationServices;
using NotificationType = UnityEngine.iOS.NotificationType;
/*
.
.
.
*/
void ACalledFunction ()
{
// Ask for permission for push notifications (Can Receive deviceToken)
#if UNITY_IPHONE
NotificationServices.RegisterForNotifications(
NotificationType.Alert |
NotificationType.Badge |
NotificationType.Sound);
#endif
}
}
UPDATE 15/06/2015 : Parse Unity SDK 1.5.1 (il2cpp scripting backend)
We re still having the same error when trying to register for parse PNs :
ExecutionEngineException: Attempting to call method
'System.Reflection.MonoProperty::StaticGetterAdapterFrame' for which
no ahead of time (AOT) code was generated.
System.Reflection.MonoProperty+GetterAdapter.Invoke (System.Object
_this) System.Reflection.MonoProperty+GetterAdapter.Invoke (System.Object _this) CurvedText.OnRectTransformDimensionsChange ()
System.Reflection.MonoProperty.GetValue (System.Object obj,
System.Object[] index)
Newtonsoft.Json.Bson.BsonString.set_IncludeLength (Boolean value)
Parse.ParseInstallation.get_Badge ()
Parse.ParseInstallation.SetPlatformAutomaticValue ()
Parse.ParseInstallation.SetAutomaticValues ()
Parse.ParseInstallation.SaveAsync (System.Threading.Tasks.Task
toAwait, CancellationToken cancellationToken)
Parse.PlatformHooks+<>c__DisplayClass42.b__36 (System.Object _)
Parse.ParseObject+<>c__DisplayClass18.b__17
(System.Threading.Tasks.Task toAwait)
FlurryAnalyticsIOS.SetSessionTimeout (Int32 seconds)
Parse.ParseObject.SetProperty[ParseACL] (Parse.ParseACL value,
System.String propertyName) Parse.Internal.TaskQueue.Enqueue[Task]
(System.Func2 taskStart, CancellationToken cancellationToken)
Parse.ParseObject.SaveAsync (CancellationToken cancellationToken)
Parse.ParseObject.SaveAsync () Parse.ParseInitializeBehaviour.b__0
(System.Byte[] deviceToken) FlurryAnalyticsIOS.SetSessionTimeout
(Int32 seconds) Newtonsoft.Json.Bson.BsonString.set_IncludeLength
(Boolean value) Parse.PlatformHooks+<>c__DisplayClass24.b__22 ()
System.Action.Invoke ()
Newtonsoft.Json.Bson.BsonString.set_IncludeLength (Boolean value)
Parse.PlatformHooks+d__44.MoveNext ()
System.Array+InternalEnumerator1[System.UInt64].get_Current ()
UnityEngine.Debug:LogException(Exception) Parse.d__44:MoveNext()
System.InternalEnumerator`1:get_Current()
It is possible to use reflection with AOT builds (both using the Mono scripting backend and the IL2CPP scripting backend). The restriction is really on using anything in the System.Reflection.Emit namespace.
Some parts of the mscorlib.dll assembly that ship with the Unity version of Mono are not friendly to AOT code paths, and System.Reflection.MonoProperty::StaticGetterAdapterFrame is one of them. This code won't work with an AOT build, but unfortunately it is not something that Unity can determine at compile time, so the error will only happen at runtime.
This is probably an issue to bring up on the Parse SDK forums. It may be that the SDK can be used differently to avoid this issue.

Monodevelop throws the following exception System.DllNotFoundException: SDL2.dll

To be more precise, here is the error I get when I try to run an application built using monogame:
System.DllNotFoundException: SDL2.dll
at (wrapper managed-to-native) SDL2.SDL:SDL_SetMainReady ()
at Microsoft.Xna.Framework.SDL2_GameWindow..ctor () [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.SDL2_GamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Game..ctor () [0x00000] in <filename unknown>:0
at MovingTeddyBears.Game1..ctor () [0x00000] in <filename unknown>:0
at MovingTeddyBears.Program.Main () [0x00000] in /home/Dan/Desktop/MonoDevelopPrograms/LinuxMonoGameMovingTeddyBears/Program.cs:19
There are no errors on compiling the program, but when I run it, I get the above output.
I am on linux mint running monodevelop 3.0.3
ldconfig -p | grep libSDL2
libSDL2_image-2.0.so.0 (libc6,x86-64) => /usr/local/lib/libSDL2_image-2.0.so.0
libSDL2-2.0.so.0 (libc6,x86-64) => /usr/local/lib/libSDL2-2.0.so.0
Any help is welcome please help me resolve this.

Categories

Resources